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

前端 未结 4 1267
囚心锁ツ
囚心锁ツ 2021-01-03 23:39

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

But I can\'t find

4条回答
  •  旧时难觅i
    2021-01-04 00:12

    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).

提交回复
热议问题