#include <iostream>
#include <string>

struct foo
{
	std::string name;
};

struct foowrapper1
{
	foo const& obj;
};

foowrapper1 print1(foo const& obj)
{
	return {obj};
}

struct foowrapper2
{
	foo const& obj;
};

foowrapper2 print2(foo const& obj)
{
	return {obj};
}

std::ostream& operator<<(std::ostream& lhs, foowrapper1 const& rhs)
{
	lhs << '(' << rhs.obj.name << ')';
}

std::ostream& operator<<(std::ostream& lhs, foowrapper2 const& rhs)
{
	lhs << '[' << rhs.obj.name << ']';
}

int main()
{
	foo f;
	f.name = "blah";

	std::cout << print1(f) << print2(f);
}