This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64455] A constexpr variable template can't be used with enable_if
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Jan 2015 10:09:34 +0000
- Subject: [Bug c++/64455] A constexpr variable template can't be used with enable_if
- Auto-submitted: auto-generated
- References: <bug-64455-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64455
--- Comment #2 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Reduced to avoid using type_traits:
template<typename Type>
constexpr bool IsType = true;
template <bool b, class T> struct Test
{
};
template <class T>
struct Test<true, T>
{
typedef T type;
};
template<class T>
struct X {
typedef typename Test<IsType<T>,T>::type type;
};
int main()
{
X<int>::type t;
}