|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59200 - trunk/boost/unordered/detail
From: daniel_james_at_[hidden]
Date: 2010-01-21 13:01:54
Author: danieljames
Date: 2010-01-21 13:01:53 EST (Thu, 21 Jan 2010)
New Revision: 59200
URL: http://svn.boost.org/trac/boost/changeset/59200
Log:
Set length of primes inside template on Sun C++. Refs #3854
Text files modified:
trunk/boost/unordered/detail/util.hpp | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
Modified: trunk/boost/unordered/detail/util.hpp
==============================================================================
--- trunk/boost/unordered/detail/util.hpp (original)
+++ trunk/boost/unordered/detail/util.hpp 2010-01-21 13:01:53 EST (Thu, 21 Jan 2010)
@@ -32,12 +32,6 @@
////////////////////////////////////////////////////////////////////////////
// primes
- template<class T> struct prime_list_template
- {
- static std::size_t const value[];
- static std::ptrdiff_t const length;
- };
-
#define BOOST_UNORDERED_PRIMES \
(5ul)(11ul)(17ul)(29ul)(37ul)(53ul)(67ul)(79ul) \
(97ul)(131ul)(193ul)(257ul)(389ul)(521ul)(769ul) \
@@ -47,14 +41,28 @@
(50331653ul)(100663319ul)(201326611ul)(402653189ul)(805306457ul) \
(1610612741ul)(3221225473ul)(4294967291ul)
+ template<class T> struct prime_list_template
+ {
+ static std::size_t const value[];
+
+#if !defined(SUNPRO_CC)
+ static std::ptrdiff_t const length;
+#else
+ static std::ptrdiff_t const length
+ = BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES);
+#endif
+ };
+
template<class T>
std::size_t const prime_list_template<T>::value[] = {
BOOST_PP_SEQ_ENUM(BOOST_UNORDERED_PRIMES)
};
+#if !defined(SUNPRO_CC)
template<class T>
std::ptrdiff_t const prime_list_template<T>::length
= BOOST_PP_SEQ_SIZE(BOOST_UNORDERED_PRIMES);
+#endif
#undef BOOST_UNORDERED_PRIMES
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk