]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/multiprecision/traits/is_byte_container.hpp
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / boost / boost / multiprecision / traits / is_byte_container.hpp
CommitLineData
7c673cae
FG
1///////////////////////////////////////////////////////////////////////////////
2// Copyright 2015 John Maddock. Distributed under the Boost
3// Software License, Version 1.0. (See accompanying file
4// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#ifndef BOOST_IS_BYTE_CONTAINER_HPP
7#define BOOST_IS_BYTE_CONTAINER_HPP
8
92f5a8d4 9#include <iterator>
1e59de90 10#include <type_traits>
7c673cae 11
92f5a8d4 12namespace boost { namespace multiprecision { namespace detail {
7c673cae 13
1e59de90
TL
14template <class T>
15struct has_member_const_iterator
16{
17 template <class U>
18 static double check(U*, typename U::const_iterator* = nullptr);
19 static char check(...);
20 static T* get();
21 static constexpr bool value = sizeof(check(get())) == sizeof(double);
22};
23
24
25template <class C, class Iterator>
26struct is_byte_container_imp_2
27{
28 using container_value_type = typename std::remove_cv<typename std::iterator_traits<typename C::const_iterator>::value_type>::type;
29 static constexpr const bool value = boost::multiprecision::detail::is_integral<container_value_type>::value && (sizeof(container_value_type) == 1);
30};
31
32template <class C>
33struct is_byte_container_imp_2<C, void> : public std::false_type
34{};
7c673cae 35
92f5a8d4 36template <class C, bool b>
1e59de90 37struct is_byte_container_imp : public is_byte_container_imp_2<C, typename C::const_iterator>
92f5a8d4 38{
92f5a8d4 39};
7c673cae 40
92f5a8d4 41template <class C>
1e59de90 42struct is_byte_container_imp<C, false> : public std::false_type
92f5a8d4 43{};
7c673cae 44
92f5a8d4
TL
45template <class C>
46struct is_byte_container : public is_byte_container_imp<C, has_member_const_iterator<C>::value>
47{};
7c673cae 48
92f5a8d4 49}}} // namespace boost::multiprecision::detail
7c673cae
FG
50
51#endif // BOOST_IS_BYTE_CONTAINER_HPP