#include <utility>

template <typename T>
struct Foo
{
	T t;
	Foo(const T& t) : t(t) { }
	Foo(T&& t) : t(std::move(t)) { }
};

struct Bar
{
	Bar() { }
	Bar(int) { }
	Bar(const Bar&) = default;
	Bar(Bar&&) = delete;
};

int main() {
	Foo<Bar> foobar1(Bar()); //compiles fine
	Foo<Bar> foobar2(Bar(5)); //error: use of deleted function 'Bar::Bar(Bar&&)
	
	return 0;
}