[typeof] Limitations in BOOST_TYPEOF_NESTED_TYPEDEF for VC8.0

It turns out that BOOST_TYPEOF_NESTED_TYPEDEF has a problem when used inside functions on VC8.0 (possibly other compilers as well) This is because BOOST_TYPEOF_NESTED_TYPEDEF internally defines a member template: struct a { template<typename T> struct b{ }; }; VC8.0 doesn't handle this (error C2892: local class shall not have member templates) It is possible to avoid this problem, but this would cripple BOOST_TYPEOF_NESTED_TYPEDEF because it would reintroduce the BOOST_TYPEOF_LIMIT_SIZE limitation on the expression complexity. The alternative is to disallow NESTED_TYPEDEF inside functions, and write a note on this in the docs. Is this acceptable? Regards, Peder

"Peder Holt" <peder.holt@gmail.com> writes:
It turns out that BOOST_TYPEOF_NESTED_TYPEDEF has a problem when used inside functions on VC8.0 (possibly other compilers as well) This is because BOOST_TYPEOF_NESTED_TYPEDEF internally defines a member template:
struct a { template<typename T> struct b{ }; };
VC8.0 doesn't handle this (error C2892: local class shall not have member templates)
It is possible to avoid this problem, but this would cripple BOOST_TYPEOF_NESTED_TYPEDEF because it would reintroduce the BOOST_TYPEOF_LIMIT_SIZE limitation on the expression complexity.
The alternative is to disallow NESTED_TYPEDEF inside functions, and write a note on this in the docs. Is this acceptable?
Didn't I post a syntax during the review that avoids the need for this macro? -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
"Peder Holt" <peder.holt@gmail.com> writes:
It turns out that BOOST_TYPEOF_NESTED_TYPEDEF has a problem when used inside functions on VC8.0 (possibly other compilers as well) This is because BOOST_TYPEOF_NESTED_TYPEDEF internally defines a member template:
struct a { template<typename T> struct b{ }; };
VC8.0 doesn't handle this (error C2892: local class shall not have member templates)
It is possible to avoid this problem, but this would cripple BOOST_TYPEOF_NESTED_TYPEDEF because it would reintroduce the BOOST_TYPEOF_LIMIT_SIZE limitation on the expression complexity.
The alternative is to disallow NESTED_TYPEDEF inside functions, and write a note on this in the docs. Is this acceptable?
Here's my vote for this one!
Didn't I post a syntax during the review that avoids the need for this macro?
IIRC it was a different one. NESTED_TYPEDEF was recently introduced for Spirit typeof support, because it doesn't ICE VC7.1 and doesn't provoke strange ADL issues with VC8. It can't be used in all contexts but therefore does (nearly) not impose any restrictions on the expression complexity. Regards, Tobias

"David Abrahams" <dave@boost-consulting.com> wrote
"Peder Holt" <peder.holt@gmail.com> writes:
It turns out that BOOST_TYPEOF_NESTED_TYPEDEF has a problem when used inside functions on VC8.0 (possibly other compilers as well) This is because BOOST_TYPEOF_NESTED_TYPEDEF internally defines a member template:
struct a { template<typename T> struct b{ }; };
VC8.0 doesn't handle this (error C2892: local class shall not have member templates)
It is possible to avoid this problem, but this would cripple BOOST_TYPEOF_NESTED_TYPEDEF because it would reintroduce the BOOST_TYPEOF_LIMIT_SIZE limitation on the expression complexity.
The alternative is to disallow NESTED_TYPEDEF inside functions, and write a note on this in the docs. Is this acceptable?
Didn't I post a syntax during the review that avoids the need for this macro?
You probably mean getting rid of BOOST_TYPEOF_TPL(), and using typename BOOST_TYPEOF() instead. If this is the case -- we did try to implement it, but failed because of the problems with one version of the gcc compiler (I think 3.3.3), debug mode, which would ICE at any attempt to wrap its native typeof into anything at all. Regards, Arkadiy
participants (4)
-
Arkadiy Vertleyb
-
David Abrahams
-
Peder Holt
-
Tobias Schwinger