Boost C++ Libraries: Ticket #9424: Build failures using unordered and Sun 5.12 compiler https://svn.boost.org/trac10/ticket/9424 <pre class="wiki">#include &lt;boost/unordered/unordered_map.hpp&gt; int main(int argc, char *argv[]) { return 0; } </pre><p> Yields </p> <pre class="wiki">"../boost_1_55_0/boost/unordered/detail/allocate.hpp", line 908: Error: Templates can only declare classes or functions. "../boost_1_55_0/boost/unordered/detail/allocate.hpp", line 908: Error: Templates can only declare classes or functions. "../boost_1_55_0/boost/unordered/detail/allocate.hpp", line 908: Error: Templates can only declare classes or functions. "../boost_1_55_0/boost/unordered/detail/allocate.hpp", line 908: Error: &lt;snip&gt; </pre><p> Looks like the scoping of the length template is wrong: </p> <pre class="wiki">--- allocate.hpp-orig 2013-11-22 15:36:29.556400000 +0000 +++ allocate.hpp 2013-11-22 15:50:13.154595000 +0000 @@ -879,7 +879,7 @@ # define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \ template&lt;typename Alloc, typename T&gt; \ void construct_from_tuple_impl( \ - boost::unordered::detail::length&lt;0&gt;, Alloc&amp;, T* ptr, \ + boost::unordered::detail::func::length&lt;0&gt;, Alloc&amp;, T* ptr, \ namespace_ tuple&lt;&gt;) \ { \ new ((void*) ptr) T(); \ @@ -892,7 +892,7 @@ template&lt;typename Alloc, typename T, \ BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)&gt; \ void construct_from_tuple_impl( \ - boost::unordered::detail::length&lt;n&gt;, Alloc&amp;, T* ptr, \ + boost::unordered::detail::func::length&lt;n&gt;, Alloc&amp;, T* ptr, \ namespace_ tuple&lt;BOOST_PP_ENUM_PARAMS_Z(z, n, A)&gt; const&amp; x) \ { \ new ((void*) ptr) T( \ @@ -921,7 +921,7 @@ void construct_from_tuple(Alloc&amp; alloc, T* ptr, Tuple const&amp; x) { construct_from_tuple_impl( - boost::unordered::detail::length&lt; + boost::unordered::detail::func::length&lt; boost::tuples::length&lt;Tuple&gt;::value&gt;(), alloc, ptr, x); } </pre><p> Thanks </p> <p> Luke Elliott. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9424 Trac 1.4.3 Daniel James Sat, 23 Nov 2013 11:43:20 GMT <link>https://svn.boost.org/trac10/ticket/9424#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9424#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86792" title="Fix unordered on Sun 5.12 compiler. Refs #9424.">[86792]</a>) Fix unordered on Sun 5.12 compiler. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9424" title="#9424: Bugs: Build failures using unordered and Sun 5.12 compiler (closed: fixed)">#9424</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Mon, 26 May 2014 21:44:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9424#comment:2 https://svn.boost.org/trac10/ticket/9424#comment:2 <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> </ul> <p> This was merged to master in: </p> <p> <a class="ext-link" href="https://github.com/boostorg/unordered/commit/038550a9df9fb219a6d4eabf73a57b98b11c95db"><span class="icon">​</span>https://github.com/boostorg/unordered/commit/038550a9df9fb219a6d4eabf73a57b98b11c95db</a> </p> Ticket