Home Using constexpr in a type dependent context
Reply: 0

Using constexpr in a type dependent context

user421 Published in June 24, 2018, 3:25 am

Easy question, is this legal?

template<class T>
struct foo {

using type = std::conditional<IF_CONDITION<T>::value, constexpr int, int>::type;


Compiler error: "error: "constexpr" is not valid here" Haven't been able to find any documentation on this. Because its a compile time condition it seems like this should be able to do in theory at least.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303601 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO