Boost logo

Boost :

Subject: Re: [boost] [mpl] mpl::c_str fails for mpl::push_back
From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2010-11-08 04:55:43


On Sun, 07 Nov 2010 02:00:42 -0600, vicente.botet
<vicente.botet_at_[hidden]> wrote:
> Ah, I've forget to ask: How is it that it works for gcc-3.4, gcc-4.3,
> gcc-4.5? Where is the value_type defined?

It's an implementation artifact: GCC has typeof, and typeof-based vectors
use inheritance to build push_back's result:

     template<>
     struct push_back_impl< aux::vector_tag >
     {
         template< typename Vector, typename T > struct apply
         {
             typedef v_item<T,Vector,0> type;
         };
     };

     template<
           typename T
         , typename Base
         , int at_front = 0
>
     struct v_item
         : Base
     {
     ...
     };

HTH,

-- 
Aleksey Gurtovoy
MetaCommunications Engineering

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