Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2001-05-23 14:12:16


e_d_k_at_[hidden] wrote on 5/23/01 3:01 PM
>Problems with type_traits
>
>I want to write something like this:
>
> int x =7;
> double f=98.6;
>
> pair<iint, double> p1(x,f);
> pair<int,double&> p2(x,f);
> cout << p1.second << endl; // prints 98.6
> cout << p2.second << endl; // prints 98.6
> f = 9.8;
> cout << p1.second << endl; // prints 98.6
> cout << p2.second << endl; // prints 9.8
>
>Of cource this is not posable with std::pair.
>
>So I decided to write an improved pair.

I believe compressed_pair already does this.

-Howard


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