
24 May
2007
24 May
'07
1:48 p.m.
"Giovanni Piero Deretta" <gpderetta@gmail.com> wrote
This works though (at least with gcc 4.1.2):
#include <vector>
template<typename T> struct identity { typedef T type; };
int main() { std::vector<int> v; typedef identity<typeof(v)>::type::iterator type; }
So BOOST_TYPEOF could include 'identity' in its expansion.
Working around the problem by _complicating_ the expression inside typeof is not a way I would go. It then may fail in another contexts, where it didn't fail before. This is clearly a compiler bug, and needs to be addressed by the compiler developers. Regards, Arkadiy