Boost logo

Boost :

Subject: Re: [boost] Interest in an 'either' library?
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-06-23 07:45:26


On 21 Jun 2013 17:36, "David Sankel" <camior_at_[hidden]> 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<A,B> 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)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk