Mercurial > thymian
view 3rdparty/vmime/cmake/cmake-cxx11/Modules/CheckCXX11Features/cxx11-test-variadic_templates.cpp @ 0:a4671277546c tip
created the repository for the thymian project
| author | ferencd |
|---|---|
| date | Tue, 17 Aug 2021 11:19:54 +0200 |
| parents | |
| children |
line wrap: on
line source
int Accumulate() { return 0; } template<typename T, typename... Ts> int Accumulate(T v, Ts... vs) { return v + Accumulate(vs...); } template<int... Is> int CountElements() { return sizeof...(Is); } int main() { int acc = Accumulate(1, 2, 3, 4, -5); int count = CountElements<1,2,3,4,5>(); return ((acc == 5) && (count == 5)) ? 0 : 1; }
