【发布时间】:2017-01-02 01:53:22
【问题描述】:
我使用 c++11,而我需要 c++17 库中的一些类。在使用添加了哪些类的 boost 时,我希望执行以下操作:
#if __cplusplus < CPP17
using std::any = boost::any;
#endif
不允许使用这样的别名。扩展 std 命名空间也会导致 undefined behaviour。我希望我的代码看起来与 c++ 版本相同。有没有明确的方法?
【问题讨论】:
-
只需使用您自己的名字并根据需要为其分配
boost::any或std::any?
标签: c++ c++11 namespaces