#include <vector>
#include <iostream>
#include <functional>

class Yoba {
public:
	Yoba();
	Yoba(const Yoba& r);
	auto getW(void);
	
private:
	int w;
	static int v;
};

std::vector<std::reference_wrapper<Yoba>> global_shit;

Yoba::Yoba() : w{ v } { ++v;  global_shit.push_back(std::ref(*this)); };
Yoba::Yoba(const Yoba& r) : w{ 0 } {};
auto Yoba::getW(void) { return w; }

int Yoba::v{ 1 };

int
main()
{
	Yoba yoba[ 10 ];
	for (auto& i : global_shit)
	{
		std::cout << i.get().getW() << std::endl; 
	}
	return 0;
}

