Boost logo

Boost Users :

Subject: Re: [Boost-users] variant with shrink
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2013-02-27 05:00:16


2013/2/27 Niitsuma Hirotaka <hirotaka.niitsuma_at_[hidden]>

> boost::variant should be
>
> variant<int,int>
> => int

> variant<int,double>
> => double
>

> variant<int,boost::rational<int> >
> => boost::rational<int>
>
> variant<int,double,std::string>
> => variant<double,std::string>
>
> 1. Is double guaranteed to be a superset of int?
2. Do you lose the information, which type is contained (int/double)?

Regards,
Kris

>
> I wrote such extension
>
> https://github.com/niitsuma/variant_shrink
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net