Opened 9 years ago
Closed 8 years ago
#9424 closed Bugs (fixed)
Build failures using unordered and Sun 5.12 compiler
Reported by: | Owned by: | Daniel James | |
---|---|---|---|
Milestone: | To Be Determined | Component: | unordered |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | Cc: |
Description
#include <boost/unordered/unordered_map.hpp> int main(int argc, char *argv[]) { return 0; }
Yields
"../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: <snip>
Looks like the scoping of the length template is wrong:
--- 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<typename Alloc, typename T> \ void construct_from_tuple_impl( \ - boost::unordered::detail::length<0>, Alloc&, T* ptr, \ + boost::unordered::detail::func::length<0>, Alloc&, T* ptr, \ namespace_ tuple<>) \ { \ new ((void*) ptr) T(); \ @@ -892,7 +892,7 @@ template<typename Alloc, typename T, \ BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \ void construct_from_tuple_impl( \ - boost::unordered::detail::length<n>, Alloc&, T* ptr, \ + boost::unordered::detail::func::length<n>, Alloc&, T* ptr, \ namespace_ tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \ { \ new ((void*) ptr) T( \ @@ -921,7 +921,7 @@ void construct_from_tuple(Alloc& alloc, T* ptr, Tuple const& x) { construct_from_tuple_impl( - boost::unordered::detail::length< + boost::unordered::detail::func::length< boost::tuples::length<Tuple>::value>(), alloc, ptr, x); }
Thanks
Luke Elliott.
Change History (2)
comment:1 by , 9 years ago
comment:2 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This was merged to master in:
https://github.com/boostorg/unordered/commit/038550a9df9fb219a6d4eabf73a57b98b11c95db
Note:
See TracTickets
for help on using tickets.
(In [86792]) Fix unordered on Sun 5.12 compiler. Refs #9424.