는 가변 인자 템플릿은 간단 갖는 매개 변수, 그것은 일부 char
s의 string_constant
인 TStringConstant
받아 들일 것, 그래서 나는 그것을 전문으로 할 수 있습니다C++는 가변 인자 템플릿의 가변 수는
template <typename TStringConstant, typename TValue>
class entry;
template <char... key, typename TValue>
class entry<string_constant<key...>, TValue>{}
내가 만들고 싶었다 경우를 다른 char
s의 TStringConstant
s의 가변 개수를 허용하는 템플릿 클래스는이를 수행하는 방법이 있습니까? 아마도 템플릿 템플릿 매개 변수가 있습니까?
다음 모두 유효 할 것이다 그래야 : 그것은 컴파일에 실패합니다 entry_list<something_else<'c','b','a'>>
단지 entry<something_else<'c','b','a'>, bool>
처럼 거부합니다
entry_list<string_constant<'c','b','a'>, string_constant<'d','e','f','g'>>();
entry_list<string_constant<'c','b','a'>, string_constant<'d','e','f','g'>, string_constant<'d','e','z','z'>>();
entry_list<string_constant<'a','b','c'>>();
보너스합니다.