#include <iostream>
#include <vector>
#include <algorithm>

class Foo
{
public:
	Foo(std::string&& str_) :
		str(std::move(str_))
	{}

	bool operator<(const Foo& other) const
	{
		return str < other.str;
	}
	
	std::string getString() 
	{
		return str;
	}
	
private:
	std::string str;
};

int main() {
	
	std::vector<Foo> v;
	v.push_back(Foo("2"));
	v.push_back(Foo("3"));
	v.push_back(Foo("1"));
	
	std::sort(v.begin(), v.end());
	for (auto x : v)
		std::cout << x.getString() << std::endl;
	return 0;
}