23 Jun
2013
23 Jun
'13
11:45 a.m.
On 21 Jun 2013 17:36, "David Sankel"
**Use 2**: A lightweight alternative to boost::variant when only 2 components are required (either relates to variant in a similar way that pair relates to tuple ). (...)
either eitherAOrB;
if( eitherAOrB.is_left() ) std::cout << "A: " << eitherAOrB.left(); else std::cout << "B: " << eitherAOrB.right();
Is there any particular reason not to follow std::pair naming and use first() and second() members? Regards, -- Mateusz Loskot (Sent from mobile, apology for top-posting and broken quotes)