Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-08-30 12:35:22


"Dirk Schreib" <Dirk.Schreib_at_[hidden]> writes:

> I would like a variant to be LessThanComparable if all
> BoundedTypes are LessThanComparable.
>
> In this example
>
> typedef boost::variant<T1, T2, ..., TN> V;
> V v1 = T1( x );
> V v2 = T2( y );
> V v3 = T1( z );
>
> v1 < v2 should always be true. And v1 < v3 should be the same as T1( x ) <
> T1( z ).
>
> I assume that the resulting variant class will be StrictWeaklyComparable if
> all
> BoundedTypes are StrictWeaklyComparable.

Sounds like maybe you want dynamic_any. Have you looked at Alexander
Nasonov's work?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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