|
Boost : |
Subject: [boost] [mpl] Basic mpl sequence question
From: Michael Robinson (michaelrobinson_at_[hidden])
Date: 2010-03-04 00:10:11
Hi,
I'm a newbie with mpl and I'm trying to execute some example code from
the book "C++ Template Metaprogramming", by Abrahams and Gurtovoy:
>From section 5.2, p. 78, Sequences and Algorithms:
I wrote this code:
//
// mpltest.C
//
#include<boost/mpl/vector.hpp>
using namespace boost;
typedef mpl::vector<char,short,int,long,float,double> types;
typedef mpl::find<types,long>::type long_pos;
int main()
{
}
And I get this compiler error on the mpl::find line:
$ g++ mpltest.C -ompltest
mpltest.C:10: error: expected initializer before â<â token
Can you tell me what I'm doing wrong?
Thank you,
Mike
FYI/IYC:
$ g++ --version
g++ (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2)
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
____________________________________________________________
Get Free Email with Video Mail & Video Chat!
http://www.netzero.net/freeemail?refcd=NZTAGOUT1FREM0210
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk