]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/container/detail/next_capacity.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / container / detail / next_capacity.hpp
index 7e6554ded063869af884f5bfc1b98e5be96729d6..0ad62ba994d3e7826778b4adb0d32fec5eb843c6 100644 (file)
@@ -18,6 +18,9 @@
 #  pragma once
 #endif
 
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+
 // container
 #include <boost/container/throw_exception.hpp>
 // container/detail
@@ -53,7 +56,12 @@ struct grow_factor_ratio
       else{
          new_cap *= Numerator;
       }
-      return max_value(SizeType(Minimum), max_value(cur_cap+add_min_cap, min_value(max_cap, new_cap)));
+      return max_value<SizeType>
+               ( SizeType(Minimum)
+               , max_value<SizeType>
+                  ( SizeType(cur_cap+add_min_cap)
+                  , min_value<SizeType>(max_cap, new_cap))
+               );
    }
 };
 
@@ -71,7 +79,20 @@ struct growth_factor_100
    : dtl::grow_factor_ratio<0, 2, 1>
 {};
 
+template<class SizeType>
+BOOST_CONTAINER_FORCEINLINE void clamp_by_stored_size_type(SizeType &, SizeType)
+{}
+
+template<class SizeType, class SomeStoredSizeType>
+BOOST_CONTAINER_FORCEINLINE void clamp_by_stored_size_type(SizeType &s, SomeStoredSizeType)
+{
+   if (s >= SomeStoredSizeType(-1) ) 
+      s = SomeStoredSizeType(-1);
+}
+
 }  //namespace container {
 }  //namespace boost {
 
+#include <boost/container/detail/config_end.hpp>
+
 #endif   //#ifndef BOOST_CONTAINER_DETAIL_NEXT_CAPACITY_HPP