Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 318 Bytes

004.md

File metadata and controls

24 lines (21 loc) · 318 Bytes
//difficulty level: medium

#include <iostream>

struct Nec {
	Nec() { std::cout << 'D'; }
	Nec(const Nec&) { std::cout << 'C'; }
	Nec& operator=(const Nec&) {
		std::cout << 'A';
		return *this;
	}
};

int main()
{
	Nec x;
	auto f1 = [x = x]()mutable {
		static Nec snec;
		x = snec;
		};
	auto f2 = f1;
}