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

Sharing is caring!

Pavlos Papadopoulos

TechNews

TheLatestTechNews is a personal news blog that is covering Latest Technology News, Computers, Smartphones, Cameras, Digital Marketing, SEO Tips & Tricks

Leave a Reply

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

shares