Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapting test for explicit variadics to fail for gcc 4.6 #1952

Merged
merged 1 commit into from Jan 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions cmake/tests/cxx11_explicit_variadic_templates.cpp
Expand Up @@ -6,7 +6,8 @@
template <typename ... Ts>
struct tuple
{
tuple() {}
template <typename ... Args>
tuple(Args && ...) {}
};

struct tag1 {};
Expand All @@ -26,12 +27,22 @@ struct tagged_type
};

template <typename ... Tags, typename ... Ts>
tuple<typename tagged_type<Tags, Ts>::type...> foo(Ts && ...)
tuple<typename tagged_type<Tags, Ts>::type...>
foo(Ts && ...)
{
return tuple<typename tagged_type<Tags, Ts>::type...>();
}

template <typename ... Tags, typename ... Ts>
tuple<typename tagged_type<Tags, Ts>::type...>
foo(tuple<Ts...> && t)
{
return tuple<typename tagged_type<Tags, Ts>::type...>();
}

int main()
{
auto t = foo<tag1, tag2, tag3>(42, 43, 44);
auto t1 = foo<tag1, tag2, tag3>(42, 43, 44);
auto t2 = foo<tag1, tag2, tag3>(tuple<int, int, int>(42, 43, 44));
}