23 Jun
2013
23 Jun
'13
4:25 p.m.
On 23 Jun 2013 13:12, "Mathias Gaunard"
On 23/06/13 13:45, Mateusz Loskot wrote:
On 21 Jun 2013 17:36, "David Sankel"
wrote: **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?
first()/second() implies a sequence with at least two elements.
Good point, thanks. -- Mateusz Loskot, http://mateusz.loskot.net