Reputation:
I was wondering if it's possible to do something like this. (i know it's really weird ^^)
bool B(true);
std::vector< (B == true) ? bool : int > v;
Upvotes: 1
Views: 222
Reputation: 18041
constexpr bool B(true);
std::vector< std::conditional_t <B == true, bool , int >> v;
Upvotes: 4