Skip to content

Add DelayedConstructor<T> #2579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 20, 2019
Merged

Add DelayedConstructor<T> #2579

merged 3 commits into from
Mar 20, 2019

Conversation

wilhuff
Copy link
Contributor

@wilhuff wilhuff commented Mar 18, 2019

This is useful for embedding C++ objects of type T inside Objective-C objects when T has no default constructor or is not a movable type. It works by allocating space for T with std::aligned_storage and then adding an Init() method that uses placement new to later construct the object in the allocated space.

See class comments for more detail and restrictions.

@wilhuff wilhuff force-pushed the wilhuff/delayed-constructor branch from b239929 to 68a8cc2 Compare March 18, 2019 21:37
@wilhuff wilhuff merged commit 38496c4 into master Mar 20, 2019
@wilhuff wilhuff deleted the wilhuff/delayed-constructor branch March 20, 2019 17:29
Corrob pushed a commit that referenced this pull request Apr 25, 2019
* Add util::DelayedConstructor

* Run sync_project on any Firestore change since start

* Use DelayedConstructor in a few places to show how it works
@firebase firebase locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants