C++17 introduces a new type-safe union in the form of std::variant. At any time, it can store a single value from one of many types. We need to include <variant> to use this feature. Let us look at a simple example to get started: First, we define a variant object v1 to hold either an int […]
Recent Comments