diff DEPENDENCIES/generic/include/boost/detail/dynamic_bitset.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/detail/dynamic_bitset.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/detail/dynamic_bitset.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -3,6 +3,9 @@
 //   Copyright (c) 2001-2002 Chuck Allison and Jeremy Siek
 //        Copyright (c) 2003-2006, 2008 Gennaro Prota
 //
+// Copyright (c) 2014 Glen Joseph Fernandes
+// glenfe at live dot com
+//
 // Distributed under the Boost Software License, Version 1.0.
 //    (See accompanying file LICENSE_1_0.txt or copy at
 //          http://www.boost.org/LICENSE_1_0.txt)
@@ -12,6 +15,7 @@
 #ifndef BOOST_DETAIL_DYNAMIC_BITSET_HPP
 #define BOOST_DETAIL_DYNAMIC_BITSET_HPP
 
+#include <memory>
 #include <cstddef>
 #include "boost/config.hpp"
 #include "boost/detail/workaround.hpp"
@@ -155,17 +159,25 @@
     // meaningful info.
     //
     template <typename T>
-    typename T::size_type vector_max_size_workaround(const T & v) {
+    inline typename T::size_type vector_max_size_workaround(const T & v)
+        BOOST_NOEXCEPT
+    {
+        typedef typename T::allocator_type allocator_type;
 
-      typedef typename T::allocator_type allocator_type;
+        const allocator_type& alloc = v.get_allocator();
 
-      const typename allocator_type::size_type alloc_max =
-                                                  v.get_allocator().max_size();
-      const typename T::size_type container_max = v.max_size();
+#if !defined(BOOST_NO_CXX11_ALLOCATOR)
+        typedef std::allocator_traits<allocator_type> allocator_traits;
 
-      return alloc_max < container_max?
-                    alloc_max :
-                    container_max;
+        const typename allocator_traits::size_type alloc_max =
+            allocator_traits::max_size(alloc);
+#else
+        const typename allocator_type::size_type alloc_max = alloc.max_size();
+#endif
+
+        const typename T::size_type container_max = v.max_size();
+
+        return alloc_max < container_max ? alloc_max : container_max;
     }
 
     // for static_asserts