Bad/Wrong use of typetraits C++

Viewed 116

I'm trying to use the typetraits enable_if but I have some troubles with the syntax probably...

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <type_traits>

template <typename _T, typename = std::enable_if_t<std::is_floating_point<_T>::value> >
struct Point {
    _T x;
    _T y;
    Point();
};

template <typename _T, typename = std::enable_if_t<std::is_floating_point<_T>::value> >
inline Point<_T, std::enable_if_t<std::is_floating_point<_T>::value> >::Point()
{
    this->x = (_T)0.0;
    this->y = (_T)0.0;
}

The error is:

1>c:\users\lukkio\documents\visual studio 2015\projects\templates\templates\templates\header.h(19): error C3860: template argument list following class template name must list parameters in the order used in template parameter list

I'm using visual studio 2015 on windows. Is it related to SFINAE somehow? How should my code be fixed to work?

1 Answers
Related