#include <iostream>

struct Foo {
	Foo() = default;
	Foo(Foo &&) {}
};

struct Bar {
	Bar() = default;
	//Bar(const Bar &) = default;
	Bar(Bar &&) = default;
};

struct Empty
{};

Foo GetFoo() {
	Foo foo;
	std::cout << "GetFoo:" << &foo << std::endl;
	return foo;
}

Bar GetBar() {
	Bar bar;
	std::cout << "GetBar:" << &bar << std::endl;
	return bar;
}

Empty GetEmpty() {
	Empty e;
	std::cout << "GetEmpty:" << &e << std::endl;
	return e;
}

int main() {
	// RVO OK
	Foo foo = GetFoo();
	std::cout << "foo:" << &foo << std::endl<< std::endl;
	// RVO GG
	Bar bar = GetBar();
	std::cout << "bar:" << &bar << std::endl<< std::endl;
	// RVO GG
	Empty empty = GetEmpty();
	std::cout << "empty:" << &empty << std::endl<< std::endl;
	return 0;
}
