简体   繁体   English

将 boost 预处理器序列扩展到 std::tuple

[英]Expanding boost preprocessor sequence to std::tuple

If I have a boost preprocessor sequence macro like:如果我有一个 boost 预处理器序列宏,例如:

#define BOOST_PP_SEQUENCE\
    (float)\
    (int)\
    (bool)\

Is it possible to convert this tuple into a std::tuple?是否可以将此元组转换为 std::tuple? I would like to convert this into something like:我想把它转换成类似的东西:

using RealTuple = ...  //resulting in std::tuple<float, int, bool>

The answer was:答案是:

using Tuple = std::tuple<BOOST_PP_SEQ_ENUM(BOOST_PP_SEQUENCE)>;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM