Boost logo

Boost Users :

Subject: Re: [Boost-users] [array] range check (at compile time)
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-03-05 21:32:39


On Fri, Mar 5, 2010 at 7:30 PM, OvermindDL1 <overminddl1_at_[hidden]> wrote:
> On Fri, Mar 5, 2010 at 11:37 AM, alfC <alfredo.correa_at_[hidden]> wrote:
>>> FYI,Fusionadaptsboostarrayas a fully conforming sequence.
>>> So:
>>>
>>>      fusion::at_c<2>(a)
>>>
>>> is perfectly valid.
>>
>> this syntax in this minimal example works (runs) but the error is
>> still at runtime
>>
>> #include<iostream>
>> #include <boost/fusion/sequence.hpp>
>> #include</usr/include/boost/fusion/adapted/array.hpp>
>> int main(){
>>        boost::array<double, 2> a;
>>        std::cout
>>                        <<boost::fusion::at_c<0>(a)<<' ' //ok
>>                        <<boost::fusion::at_c<1>(a)<<' ' //ok
>>                        <<boost::fusion::at_c<2>(a)<<std::endl; //gives error but at
>> runtime (boost/array.hpp runtime assertion)
>>        return 0;
>> }
>
> Hmm, shouldn't the adaptor for boost::array use the template parameter
> of boost::array to define its extant?
>

/extant/extent
Helps if I can spell...


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