SFINAE와 (과) 놀고있어 내 입력을 확인하려고합니다. 다양한 유형의 입력으로 이루어져 있습니다. clang이 제공 한 오류는별로 도움이되지 않습니다. 너는 어떤 생각을 가지고 있니?Variadic 템플릿 템플릿 및 SFINAE
감사
다른struct IsFree
{
};
template <typename _Type, typename _State>
struct Input
{
};
template <typename... _Inputs>
struct Inputs
{
};
template <template <typename _Type, typename _State> class, typename... _Inputs>
struct Inputs<Input<_Type, _State>, _Inputs...> : public Inputs<_Inputs...>
{
};
어딘가에 : 나는 그 소리-5.0을 사용하고 -std = C++ 17 얻을
auto temp = Inputs<Input<float, IsFree>, Input<float, IsFree>> {};
:
13 : <source>:13:21: error: use of undeclared identifier '_Type'
struct Inputs<Input<_Type, _State>, _Inputs...> : public Inputs<_Inputs...>
^
13 : <source>:13:35: error: expected a type
struct Inputs<Input<_Type, _State>, _Inputs...> : public Inputs<_Inputs...>
^
2 errors generated.
Compiler exited with result code 1
밑줄 문자와 대문자로 시작하는 식별자는 예약되어 있습니다. 이것은 선언되지 않은 동작입니다. ['[lex.name]/3.1']의 규칙 (http://eel.is/c++draft/lex.name#3.1). – YSC
** SFINAE **, 아니 SNIFAE. 대체 실패는 오류가 아닙니다. – Constructor