sorry i want to know how to insert them not to how to copy tehm .
like Container of boost of array .
 
vector<boost::array<int, 4> > v;
v.push_back({4, 9, 11, 19});

 
On 11/24/06, David Klein <dave_chp@gmx.de> wrote:
chun ping wang wrote:
> hi i would like to know how to insert boost::array into containers
> such as vectors, list, etc, in an effective and easy way.. tuples
> don't work cause you can't get to random access index. Thanks.
>
> AES word example.
> typedef boost::array<int, 4> word;
>
> std::vector vecOfWord;
>
> // perform some word insertion.
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users@lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
#include <boost/array.hpp>

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
using namespace boost;

int main( int argc, char * argv[] )
{
   array<int, 5> a = {0, 1, 2, 3, 4};
   vector<int> v( a.begin(), a.end());

   copy(v.begin(), v.end(), ostream_iterator<int>(cout, "\n"));
   return 0;
}

--
HTH dave

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users