I'm playing with this little snippet:
#include <tuple>
struct copy_only
{
copy_only() = default;
copy_only(copy_only&&) = delete;
copy_only(const copy_only&) = default;
};
template <typename ...Ts>
void foo(Ts&& ...xs)
{
auto t = std::make_tuple(std::forward<Ts>(xs)...);
(void) t;
}
int main()
{
foo(copy_only{});
}
It compiles fine with gcc7 and clang3.6, clang3.7, clang3.8 (Wandbox), and clang8.0 (macOS Sierra). It doesn't compile with clang3.9, g++6.2 (macOS Sierra) nor with clang4.0 (Wandbox). All of them complain about deleted move constructor.
It works fine with move-only types. At least on the above compilers available on Wandbox.
Is this code an example of a correct way of generic perfect forwarding into a tuple in c++14?