Boost.Locale
allocator_traits.hpp
1//
2// Copyright (c) 2024 Alexander Grund
3//
4// Distributed under the Boost Software License, Version 1.0.
5// https://www.boost.org/LICENSE_1_0.txt
6
7#ifndef BOOST_LOCALE_DETAIL_ALLOCATOR_TRAITS_HPP_INCLUDED
8#define BOOST_LOCALE_DETAIL_ALLOCATOR_TRAITS_HPP_INCLUDED
9
10#include <boost/locale/config.hpp>
11#include <memory>
12#include <type_traits>
13
15namespace boost { namespace locale { namespace conv { namespace detail {
16 template<class Alloc, typename T>
17 using rebind_alloc = typename std::allocator_traits<Alloc>::template rebind_alloc<T>;
18
19 template<class Alloc, typename T, typename Result = void>
20 using enable_if_allocator_for =
21 typename std::enable_if<std::is_same<typename Alloc::value_type, T>::value, Result>::type;
22 template<class Alloc, typename T, class Alloc2, typename T2, typename Result = void>
23 using enable_if_allocator_for2 = typename std::enable_if<std::is_same<typename Alloc::value_type, T>::value
24 && std::is_same<typename Alloc2::value_type, T2>::value,
25 Result>::type;
26}}}} // namespace boost::locale::conv::detail
27
29
30#endif