In-Place Construction for std::any, std::variant, and std::optional

When you read articles or reference pages for std::any, std::optional, or std::variant you might notice a few helper types called in_place_* available in constructors.

Why do we need such syntax? Is this more efficient than the "standard" construction?

DZone Web Dev Zone

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.