Boost logo

Boost :

From: Joe Gottman (jgottman_at_[hidden])
Date: 2006-05-18 19:48:28


"David Abrahams" <dave_at_[hidden]> wrote in message
news:uves3axtp.fsf_at_boost-consulting.com...
>
> I find myself creating this class member:
>
> compressed_pair<
> storage
> , compressed_pair<
> Lookup
> , compressed_pair<
> GetUnstored
> , SetUnstored
> >
> >
> > members;
>
>
> I imagine this sort of usage is pretty common. The problem is that
> it's hard to initialize this member efficiently: you have to build and
> copy too many compressed_pairs. I propose to extend compressed_pair
> with overloaded ctors, as follows:
>
> compressed_pair(
> first_param_type f
> , typename second_type::first_param_type sf
> , typename second_type::second_param_type ss);
>
> compressed_pair(
> first_param_type f
> , typename second_type::first_param_type sf
> , typename second_type::second_type::first_param_type ssf
> , typename second_type::second_type::second_param_type sss );
>
> ...
>
> etc.
>
> If SFINAE doesn't take out these declarations when the second type is
> not a (compressed_)pair, we can always template them.
>
>
> Thoughts?

   The first thought that comes to my mind is that this situation cries out
for a compressed_tuple class. How difficult would it be to write one?

Joe Gottman


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