diff --git a/include/camp/tuple.hpp b/include/camp/tuple.hpp index ccb2d6b..f5001ea 100644 --- a/include/camp/tuple.hpp +++ b/include/camp/tuple.hpp @@ -326,13 +326,17 @@ struct tuple { { } - template + template ::type* = nullptr> CAMP_HOST_DEVICE constexpr explicit tuple(const tuple& rhs) : base(internal::expand_tag{}, rhs) { } - template + template ::type* = nullptr> CAMP_HOST_DEVICE constexpr explicit tuple(tuple&& rhs) : base(internal::expand_tag{}, rhs) { diff --git a/test/tuple.cpp b/test/tuple.cpp index a105644..cde4bad 100644 --- a/test/tuple.cpp +++ b/test/tuple.cpp @@ -197,6 +197,10 @@ static_assert( "can by trivially copy constructed"); #endif +// Test to ensure correct constructor is invoked when constructing from a single tuple argument +static_assert(std::is_same>>::value, + "Avoids conversion constructor for a single tuple argument"); + // Execution tests TEST(CampTuple, AssignCompat)