Boost logo

Boost Users :

Subject: Re: [Boost-users] using boost.foreach with boost.array
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2009-02-02 09:12:16


On Mon, Feb 2, 2009 at 12:01 PM, Sean Farrow
<sean.farrow_at_[hidden]>wrote:

> Hi:
> is it possible to use boost.foreach with boost.array?
> Cheers
> Sean.
>
>
What do you think?

#include <boost/array.hpp>
#include <iostream>
#include <boost/foreach.hpp>

int main( )
{
  boost :: array<char, 6> s = { 'H', 'e', 'l', 'l', 'o', '\n' };
  BOOST_FOREACH( char c, s )
  {
    std :: cout << c;
  }
  std :: cout << "\n";

}

-- 
ACCU - Professionalism in programming - http://www.accu.org


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