
Thanks to the workaround independently suggested by Daniel and Aleksey, the test now compiles successfully in both VC7.1 and GCC 3.3. The workaround actually also took care of the case when typeof is emulated. The bottomline -- GCC doesn't like typeof to be used in the return type of a function template, whether this is a native typeof, or emulated one :-) (after I performed some simplifications of my code, the error I ended up with is: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11869, which is a duplicate of another error, which is "SUSPENDED". But, since the native typeof also doesn't work in the same context, and since the same workaround works for both, I consider the issue resolved) Neither compiler reported any ODR violation. So I invite you to take another look at the simplified registration process. Another small addition was two macros: BOOST_TYPEOF_TPL(expr), and BOOST_AUTO_TPL(var, expr) that are intended to be used in templates, when the expression depends on template parameters. These macros take care of adding or not adding the "typname" keyword depending on whether typeof is emulated, or the native one is used. http://groups.yahoo.com/group/boost/files/typeof.zip (or Spirit CVS) Thanks again for helping me with GCC issue. Arkadiy

"Arkadiy Vertleyb" <vertleyb@hotmail.com> writes:
Neither compiler reported any ODR violation.
So I invite you to take another look at the simplified registration process. Another small addition was two macros:
BOOST_TYPEOF_TPL(expr), and BOOST_AUTO_TPL(var, expr)
that are intended to be used in templates, when the expression depends on template parameters. These macros take care of adding or not adding the "typname" keyword depending on whether typeof is emulated, or the native one is used.
We should try this stuff out with EDG-based compilers in their "template repository" link-time-instantiation mode. Also I think Metrowerks now supports the same thing. These are the most likely configurations to report problems from ODR violations. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
Arkadiy Vertleyb
-
David Abrahams