"constexpr if" 不支持使用别名?

"constexpr if" not support alias using?

我使用 gcc7.1 编译代码,但出现了一些编译错误:

错误:在“if”之前需要不合格的 id

错误:在“else”之前需要不合格的 id

class Test
{
    int a{1};
    string b{"test"};
    public:
          template <int N> auto & get()
          {
             if constexpr (N==0)
                 return a;
             else
                 return b;
          }
};

namespace std {
    template<> struct tuple_size<Test> { static const int value = 2; };
    template<size_t N> struct tuple_element<N, Test>
    {
        if constexpr (N==0)  //error: expected unqualified-id before ‘if’
            using type = int;
        else                 //error: expected unqualified-id before ‘else’
          using type = string;
        //using type = conditional_t<N==0, int, string>; //this works
    };
}

constexpr if 语句仍然是 if 语句,只能出现在可以使用 if 语句的上下文中。

这不包括 class(模板)定义。