Boost logo

Boost :

From: Ken Alverson (Ken_at_[hidden])
Date: 2003-07-10 16:29:05

"Marshall Clow" <marshall_at_[hidden]> wrote in message
> So, here they are. Are they useful to anyone else? Is there some reason that
> they don't already exist? Did I miss them somewhere?
> template <class T1, class T2>
> struct first: std::unary_function< std::pair <T1, T2>, T1>
> {
> T1 operator()(const std::pair <T1, T2> & x) const { return x.first;}
> };


const T1& operator()(const std::pair <T1, T2>& x) const {return x.first;}

be more appropriate? And would a matching

T1& operator()(std::pair <T1, T2>& x) const {return x.first;}

make sense?


Boost list run by bdawes at, gregod at, cpdaniel at, john at