Does C++11 standard provide something like boost::any?

dev_null picture dev_null · Feb 8, 2012 · Viewed 15.2k times · Source

for example boost::function is moved almost entirely to std::function, the same is with boost::shared_ptr

But I can't find std::any? Was it renamed or was not it placed in new standard at all by any reason?

Answer

Alexandre Pereira Nunes picture Alexandre Pereira Nunes · Jun 9, 2015

Since the question was asked, we advanced towards std::experimental::any as an optional feature voted out of C++14 standard.

It was then implemented in GCC 5.1, at least.

The feature was since then standardized in C++17 resulting in std::any. See also C++17's std::variant for a type-safe union which either holds one of a limited known-types alternative, or is empty (thanks remy-lebeau for the tip).