Boost C++ Libraries: Ticket #9267: flat_set and flat_map can't compile in VS2013 (variadic templates activated) https://svn.boost.org/trac10/ticket/9267 <p> I experimented the following: </p> <p> In a fresh copy of boost trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/86347" title="Update 1.55 release notes, regenerate docs.">r86347</a>, I made the following change: </p> <ol><li>go in boost/config/compiler/visualc.hpp </li><li>replace </li></ol><pre class="wiki">// C++11 features supported by VC++ 12 (aka 2013). // #if _MSC_FULL_VER &lt; 180020827 # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS # define BOOST_NO_CXX11_DELETED_FUNCTIONS # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS # define BOOST_NO_CXX11_RAW_LITERALS # define BOOST_NO_CXX11_TEMPLATE_ALIASES # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES # define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX #endif // variadic templates are supposed to be supported by VC++ 12 // but VC++ 12 RC variadic support is causing boost regression // test failures for signals2 and several of its dependencies. #define BOOST_NO_CXX11_VARIADIC_TEMPLATES </pre><p> by </p> <pre class="wiki"> // C++11 features supported by VC++ 12 (aka 2013). // #if _MSC_FULL_VER &lt; 180020827 # define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS # define BOOST_NO_CXX11_DELETED_FUNCTIONS # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS # define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS # define BOOST_NO_CXX11_RAW_LITERALS # define BOOST_NO_CXX11_TEMPLATE_ALIASES # define BOOST_NO_CXX11_TRAILING_RESULT_TYPES # define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX // variadic templates are supposed to be supported by VC++ 12 // but VC++ 12 RC variadic support is causing boost regression // test failures for signals2 and several of its dependencies. # define BOOST_NO_CXX11_VARIADIC_TEMPLATES #endif </pre><ol start="3"><li>compile boost with vc12 - no error in the log, I checked this time but I didn't try to run the tests; </li></ol><p> Doing this fixes synchronized_value for me. </p> <p> However, there is a strange compilation error I can't decipher with flat_set and flat_map. Compiling: </p> <pre class="wiki"> #include &lt;boost/container/flat_map.hpp&gt; boost::container::flat_map&lt;int, int&gt; foo; </pre><p> Generates the following error (please ignore the file names, I replaced all the code by the code above): </p> <pre class="wiki"> 1&gt;e:\projects\sdk\boost\boost\include\boost-1_55\boost\intrusive\detail\has_member_function_callable_with.hpp(200): error C2228: left of '.select_on_container_copy_construction' must have class/struct/union 1&gt; type is 'boost::move_detail::add_rvalue_reference&lt;U&gt;::type' 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\intrusive\detail\has_member_function_callable_with.hpp(276) : see reference to class template instantiation 'boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction_impl&lt;Fun,true,&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Fun=std::allocator&lt;std::pair&lt;int,int&gt;&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\allocator_traits.hpp(262) : see reference to class template instantiation 'boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction&lt;const Alloc,&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Alloc=std::allocator&lt;std::pair&lt;int,int&gt;&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\flat_map.hpp(113) : see reference to class template instantiation 'boost::container::allocator_traits&lt;Allocator&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Allocator=std::allocator&lt;std::pair&lt;int,int&gt;&gt; 1&gt; ] 1&gt; e:\projects\games\netrush\netrush_projects\projects\netrush\system\view\tests\anyvalueset.cpp(288) : see reference to class template instantiation 'boost::container::flat_map&lt;int,int,std::less&lt;Key&gt;,std::allocator&lt;std::pair&lt;Key,T&gt;&gt;&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Key=int 1&gt; , T=int 1&gt; ] Build has been canceled. </pre><p> With the following code: </p> <pre class="wiki"> #include &lt;boost/container/flat_set.hpp&gt; boost::container::flat_set&lt;int, int&gt; foo; </pre><p> I get these errors: </p> <pre class="wiki"> 1&gt;e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\detail\flat_tree.hpp(50): error C2516: 'Compare' : is not a legal base class 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\detail\flat_tree.hpp(110) : see declaration of 'Compare' 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\detail\flat_tree.hpp(110) : see reference to class template instantiation 'boost::container::container_detail::flat_tree_value_compare&lt;Compare,Value,KeyOfValue&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Compare=int 1&gt; , Value=int 1&gt; , KeyOfValue=boost::container::container_detail::identity&lt;int&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\detail\flat_tree.hpp(170) : see reference to class template instantiation 'boost::container::container_detail::flat_tree&lt;Key,Key,boost::container::container_detail::identity&lt;Key&gt;,Compare,Allocator&gt;::Data' being compiled 1&gt; with 1&gt; [ 1&gt; Key=int 1&gt; , Compare=int 1&gt; , Allocator=std::allocator&lt;int&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\flat_set.hpp(75) : see reference to class template instantiation 'boost::container::container_detail::flat_tree&lt;Key,Key,boost::container::container_detail::identity&lt;Key&gt;,Compare,Allocator&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Key=int 1&gt; , Compare=int 1&gt; , Allocator=std::allocator&lt;int&gt; 1&gt; ] 1&gt; e:\projects\games\netrush\netrush_projects\projects\netrush\system\view\tests\anyvalueset.cpp(288) : see reference to class template instantiation 'boost::container::flat_set&lt;int,int,std::allocator&lt;Key&gt;&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Key=int 1&gt; ] 1&gt;e:\projects\sdk\boost\boost\include\boost-1_55\boost\intrusive\detail\has_member_function_callable_with.hpp(200): error C2228: left of '.select_on_container_copy_construction' must have class/struct/union 1&gt; type is 'boost::move_detail::add_rvalue_reference&lt;U&gt;::type' 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\intrusive\detail\has_member_function_callable_with.hpp(276) : see reference to class template instantiation 'boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction_impl&lt;Fun,true,&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Fun=std::allocator&lt;int&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\allocator_traits.hpp(262) : see reference to class template instantiation 'boost::container::container_detail::has_member_function_callable_with_select_on_container_copy_construction&lt;const Alloc,&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Alloc=std::allocator&lt;int&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\vector.hpp(279) : see reference to class template instantiation 'boost::container::allocator_traits&lt;Allocator&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Allocator=std::allocator&lt;int&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\vector.hpp(550) : see reference to class template instantiation 'boost::container::container_detail::vector_alloc_holder&lt;Allocator,boost::container::container_detail::integral_constant&lt;unsigned int,1&gt;&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Allocator=std::allocator&lt;int&gt; 1&gt; ] 1&gt; e:\projects\sdk\boost\boost\include\boost-1_55\boost\container\detail\flat_tree.hpp(167) : see reference to class template instantiation 'boost::container::vector&lt;Value,A&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Value=int 1&gt; , A=std::allocator&lt;int&gt; 1&gt; ] Build has been canceled. </pre><p> So I'm not sure if it's related to variadic templates activated or not but it don't look so. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9267 Trac 1.4.3 anonymous Wed, 15 Jan 2014 00:53:40 GMT <link>https://svn.boost.org/trac10/ticket/9267#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9267#comment:1</guid> <description> <p> Any updates on this? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Wed, 15 Jan 2014 14:20:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9267#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9267#comment:2</guid> <description> <p> I think it's fixed in Git develop branch, but I have no access to Visual 2013 to test it and regression tests are still broken due to the Git switch. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 15 Jan 2014 17:31:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9267#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9267#comment:3</guid> <description> <p> Ok, thanks for the update. </p> <p> I uncovered this as well which says it's been fixed: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/9332"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/9332</a> </p> </description> <category>Ticket</category> </item> <item> <author>mjklaim@…</author> <pubDate>Wed, 15 Jan 2014 20:39:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9267#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9267#comment:4</guid> <description> <p> I think it's fixed (I'm the reporter), I use a more recent trunk revision from svn with VS2013 and have been doing so for several months, no problem anymore. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 15 Jan 2014 21:57:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9267#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9267#comment:5</guid> <description> <p> And I too can confirm applying the patch in 9332 fixes the issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 13 Feb 2014 13:06:52 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9267#comment:6 https://svn.boost.org/trac10/ticket/9267#comment:6 <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">duplicate</span> </li> </ul> <p> Thanks for the report, marking this as duplicate of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9332" title="#9332: Bugs: has_member_function_callable_with.hpp compile error on msvc-12.0 - ... (closed: fixed)">#9332</a> </p> Ticket