
On 5/24/07, Arkadiy Vertleyb <vertleyb@hotmail.com> wrote:
"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.
Agreed, In fact I said myself that the 'simple' solution could break with more complex expressions.
This is clearly a compiler bug, and needs to be addressed by the compiler developers.
Well, boost as plenty of workarounds for broken compilers, so I do not think this matter much. Even if gcc developers fixthis, older releases will be still broken. Anyways, IIRC next release might support decltype, so the issue is moot. gpd