|
Boost Users : |
Subject: Re: [Boost-users] [array] range check (at compile time)
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-03-05 21:30:57
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?
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