views:

50

answers:

1

Simple question; right now I have something like this:

typedef void(*MyFunctionPointer)(int);
typedef std::vector < MyFunctionPointer > MyFunctionPointerContainer;

However, I want to typedef this container in one row, skipping the first typedef, how can I do this?

+8  A: 
typedef std::vector < void(*)(int) > MyFunctionPointerContainer;
a1ex07
Damn you! Beat me by 4 seconds; +1 and nuking my duplicate.
Billy ONeal
+1, but I would still go with the typedef because I'd much rather write `for( MyFunctionPointerContainer::iterator it = ... )` than `for( std::vector < void(*)(int) >::iterator it = ...)`
John Dibling
`typedef MyFunctionPointerContainer::iterator MyFunctionPointerIterator; ` would also work...
a1ex07
With the new C++0x auto keyword, this will be a moot point and was defined for these types of convoluted type typing.
David