Boost logo

Boost Users :

Subject: Re: [Boost-users] [array] range check (at compile time)
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-03-05 13:37:43


> 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;
}


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