How to query a constexpr std::tuple at compile time?

后端 未结 3 1332
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 18:14

In C++0x, one can create a constexpr std::tuple, e.g. like

#include 
constexpr int i = 10;
constexpr float f = 2.4f;
constexpr double d = -10.4;         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 18:32

    I have not yet worked with C++0x, but it seems to me that std::get() is a function, rather than expression the compiler can directly interpret. As such, it has no meaning except at runtime, after the function itself has been compiled.

提交回复
热议问题