ja****@gmail.com wrote:
>
I have a class Foo that I use both as a Foo<doubleand a Foo<float>.
You have a template named Foo, from which you create two classes,
Foo<doubleand Foo<float>.
I
want to put instances of this class in a list container. The list
container itself is a template and need a type argument. The naive way
below does not work.
list<Bar<double>myList;
It produces the error message: Error: "," expected instead of ">>". How
do I solve this problem?
typedef Foo<doubledescriptive_name;
list<descriptive_namemyList;
or:
list< Foo<double myList;
or wait for a C++0x compiler, which will be available sometime in the
next ten years, and will accept:
list<Foo<double>myList;
--
-- Pete
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." For more information about this book, see
www.petebecker.com/tr1book.