标签: c++ declaration conditional-operator
我想知道是否可以做这样的事情。 (我知道这真的很奇怪^^)
bool B(true); std::vector< (B == true) ? bool : int > v;
答案 0 :(得分:4)
constexpr bool B(true); std::vector< std::conditional_t <B == true, bool , int >> v;