From: Douglas Gregor Date: Mon, 3 Jan 2011 17:25:02 +0000 (+0000) Subject: Another variadic template metafunction test case: summing values. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dee196ef31073b40c48d60d9fa626ee1d8daaaee;p=clang Another variadic template metafunction test case: summing values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122752 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp b/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp index d9a3b5c27f..c0a9eb6cd6 100644 --- a/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp +++ b/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp @@ -65,7 +65,7 @@ namespace Replace { tuple>::value? 1 : -1]; } -namespace Multiply { +namespace Math { template struct double_values { typedef int_tuple type; @@ -89,8 +89,22 @@ namespace Multiply { typedef int_tuple<(Values*Values)...> type; }; - int check2[is_same>::type, + int check2[is_same >::type, int_tuple<1, 4, 9>>::value? 1 : -1]; + + template struct sum; + + template + struct sum { + static const int value = First + sum::value; + }; + + template<> + struct sum<> { + static const int value = 0; + }; + + int check3[sum<1, 2, 3, 4, 5>::value == 15? 1 : -1]; } namespace Indices {