Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82088 - sandbox/static_vector/boost/container/detail
From: adam.wulkiewicz_at_[hidden]
Date: 2012-12-18 19:21:35


Author: awulkiew
Date: 2012-12-18 19:21:34 EST (Tue, 18 Dec 2012)
New Revision: 82088
URL: http://svn.boost.org/trac/boost/changeset/82088

Log:
Added handling of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Text files modified:
   sandbox/static_vector/boost/container/detail/static_vector_util.hpp | 29 +++++++++++++++++++++--------
   1 files changed, 21 insertions(+), 8 deletions(-)

Modified: sandbox/static_vector/boost/container/detail/static_vector_util.hpp
==============================================================================
--- sandbox/static_vector/boost/container/detail/static_vector_util.hpp (original)
+++ sandbox/static_vector/boost/container/detail/static_vector_util.hpp 2012-12-18 19:21:34 EST (Tue, 18 Dec 2012)
@@ -25,15 +25,17 @@
 #include <boost/type_traits/has_trivial_copy.hpp>
 #include <boost/type_traits/has_trivial_constructor.hpp>
 #include <boost/type_traits/has_trivial_destructor.hpp>
-#include <boost/type_traits/has_nothrow_constructor.hpp>
-#include <boost/type_traits/has_nothrow_copy.hpp>
-#include <boost/type_traits/has_nothrow_assign.hpp>
+//#include <boost/type_traits/has_nothrow_constructor.hpp>
+//#include <boost/type_traits/has_nothrow_copy.hpp>
+//#include <boost/type_traits/has_nothrow_assign.hpp>
 //#include <boost/type_traits/has_nothrow_destructor.hpp>
 
 #include <boost/iterator/iterator_traits.hpp>
 
 namespace boost { namespace container { namespace detail { namespace static_vector {
 
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
 template <typename I, typename O>
 struct are_corresponding_pointers :
     ::boost::mpl::and_<
@@ -51,21 +53,22 @@
 {};
 
 template <typename V>
-inline void copy_dispatch(const V * first, const V * last, V * dst,
+inline V * copy_dispatch(const V * first, const V * last, V * dst,
                           boost::mpl::bool_<true> const& /*use_memcpy*/)
 {
     ::memcpy(dst, first, sizeof(V) * std::distance(first, last));
+ return dst;
 }
 
 template <typename I, typename O>
-inline void copy_dispatch(I first, I last, O dst,
+inline O copy_dispatch(I first, I last, O dst,
                           boost::mpl::bool_<false> const& /*use_memcpy*/)
 {
- std::copy(first, last, dst); // may throw
+ return std::copy(first, last, dst); // may throw
 }
 
 template <typename I, typename O>
-inline void copy(I first, I last, O dst)
+inline O copy(I first, I last, O dst)
 {
     namespace bm = ::boost::mpl;
     typedef typename
@@ -76,9 +79,19 @@
>
>::type use_memcpy;
     
- copy_dispatch(first, last, dst, use_memcpy()); // may throw
+ return copy_dispatch(first, last, dst, use_memcpy()); // may throw
 }
 
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+template <typename I, typename O>
+inline O copy(I first, I last, O dst)
+{
+ return std::copy(first, last, dst);
+}
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
 }}}} // namespace boost::container::detail::static_vector
 
 #endif // BOOST_CONTAINER_DETAIL_STATIC_VECTOR_UTIL_HPP


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