rebind.hpp 886 B

12345678910111213141516171819202122232425
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright 2012 John Maddock.
  3. // Copyright Christopher Kormanyos 2013. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. #ifndef BOOST_MP_DETAIL_REBIND_HPP
  8. #define BOOST_MP_DETAIL_REBIND_HPP
  9. namespace boost { namespace multiprecision { namespace backends { namespace detail
  10. {
  11. template <class value_type, class my_allocator>
  12. struct rebind
  13. {
  14. #ifndef BOOST_NO_CXX11_ALLOCATOR
  15. typedef typename std::allocator_traits<my_allocator>::template rebind_alloc<value_type> type;
  16. #else
  17. typedef typename my_allocator::template rebind<value_type>::other type;
  18. #endif
  19. };
  20. } } } } // namespace boost::multiprecision::backends::detail
  21. #endif // BOOST_MP_DETAIL_REBIND_HPP