Boost C++ Libraries: Ticket #4593: Type_of does not use BOOST_TYPEOF_EMULATION for VC10 and \Za https://svn.boost.org/trac10/ticket/4593 <p> Type_of does not use BOOST_TYPEOF_EMULATION for VC10 and \Za. </p> <p> For example boost/math/libs/test/pow_test.cpp </p> <p> fails to compile with \Za (No MS extensions) </p> <p> I:\boost-trunk\boost/typeof/msvc/typeof_impl.hpp(125): error C2143: syntax error : missing ';' before '&lt;' </p> <blockquote> <p> I:\boost-trunk\boost/typeof/msvc/typeof_impl.hpp(133) : see reference to class template instantiation 'boost::type_of::msvc_extract_type&lt;ID,T&gt;' being compiled </p> </blockquote> <p> I:\boost-trunk\boost/typeof/msvc/typeof_impl.hpp(125): error C2913: explicit specialization; 'boost::type_of::msvc_extract_type&lt;ID,boost::type_of::msvc_extract_type_default_param&gt;::id2type_impl' is not a specialization of a class template I:\boost-trunk\boost/typeof/msvc/typeof_impl.hpp(125): error C2059: syntax error : '&lt;' I:\boost-trunk\boost/typeof/msvc/typeof_impl.hpp(126): error C2334: unexpected token(s) preceding '{'; skipping apparent function body </p> <blockquote> <p> using native typeof </p> </blockquote> <p> I:\boost-trunk\boost/typeof/msvc/typeof_impl.hpp(125): error C2143: syntax error : missing ';' before '&lt;' ... </p> <p> #define BOOST_TYPEOF_NATIVE </p> <p> produces same error </p> <p> #define BOOST_TYPEOF_EMULATION </p> <p> Works OK </p> <p> pow_test.cpp </p> <blockquote> <p> using typeof emulation Generating code </p> </blockquote> <p> ... </p> <p> Would I be right in hoping that native type_of would be used for VC10? </p> <p> (I note tests for VC &gt;= 1400 but none for later versions). </p> <p> Or that emulation would be selected automatically for VC10? </p> <p> Or does using \Za mean type_of cannot be used? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4593 Trac 1.4.3 Paul A. Bristow Thu, 26 Aug 2010 09:23:09 GMT <link>https://svn.boost.org/trac10/ticket/4593#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4593#comment:1</guid> <description> <p> And BTW, the docs haven't kept up with these (new?) macros BOOST_TYPEOF_NATIVE and BOOST_TYPEOF_EMULATION and perhaps others (is switch for compilation with C++0x on/off?). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 30 Aug 2010 00:42:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4593#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4593#comment:2</guid> <description> <p> Is there a predefined macro to detect /Za? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 30 Aug 2010 00:45:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4593#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4593#comment:3</guid> <description> <p> Okay, it's _MSC_EXTENSIONS. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peder Holt</dc:creator> <pubDate>Mon, 30 Aug 2010 07:11:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4593#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4593#comment:4</guid> <description> <p> I tried replacing the msvc hack with decltype for VC10, but had some problems with ensure_obj for functions. I allso note that BOOST_NO_DECLTYPE is defined for this compiler, so the best approach is probably to revert to typeof emulation when _MSC_EXTENSIONS is defined. I will try to implement this later today. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peder Holt</dc:creator> <pubDate>Mon, 30 Aug 2010 19:33:00 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/4593#comment:5 https://svn.boost.org/trac10/ticket/4593#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> This should now be fixed. When _MSC_EXTENSIONS is defined, BOOST_TYPEOF_EMULATION will be defined. </p> Ticket Paul A. Bristow Thu, 02 Sep 2010 10:55:11 GMT <link>https://svn.boost.org/trac10/ticket/4593#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4593#comment:6</guid> <description> <p> This seems to have cured the failures in Boost.Math pow_test. Thanks. </p> </description> <category>Ticket</category> </item> </channel> </rss>