|
You are here |
nelari.us | ||
| | | | |
www.fluentcpp.com
|
|
| | | | | Expressive code in C++ | |
| | | | |
eyakubovich.github.io
|
|
| | | | | Suppose we need to write a factory function that constructs a runtime polymorphic object. For the purposes of this post, let's say we want to construct a concrete shape object - a rectangle, triangle, or an ellipse. Here are our basic declarations: 1 2 3 4 5 6 7 8... | |
| | | | |
www.cppstories.com
|
|
| | | | | With std::optional you can represent some Type or nothing. With std::variant you can wrap several variants into one entity. And C++17 gives us one more wrapper type: std::any that can hold anything in a type-safe way. The Basics So far in the Standard C++, you had not many options when it comes to holding variable types in a variable. | |
| | | | |
0xd34df00d.me
|
|
| | | |||