Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:36

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CXX03___MEMORY_USES_ALLOCATOR_H
0011 #define _LIBCPP___CXX03___MEMORY_USES_ALLOCATOR_H
0012 
0013 #include <__cxx03/__config>
0014 #include <__cxx03/__type_traits/is_convertible.h>
0015 #include <__cxx03/cstddef>
0016 
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 #  pragma GCC system_header
0019 #endif
0020 
0021 _LIBCPP_BEGIN_NAMESPACE_STD
0022 
0023 template <class _Tp>
0024 struct __has_allocator_type {
0025 private:
0026   template <class _Up>
0027   static false_type __test(...);
0028   template <class _Up>
0029   static true_type __test(typename _Up::allocator_type* = 0);
0030 
0031 public:
0032   static const bool value = decltype(__test<_Tp>(0))::value;
0033 };
0034 
0035 template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value>
0036 struct __uses_allocator : public integral_constant<bool, is_convertible<_Alloc, typename _Tp::allocator_type>::value> {
0037 };
0038 
0039 template <class _Tp, class _Alloc>
0040 struct __uses_allocator<_Tp, _Alloc, false> : public false_type {};
0041 
0042 template <class _Tp, class _Alloc>
0043 struct _LIBCPP_TEMPLATE_VIS uses_allocator : public __uses_allocator<_Tp, _Alloc> {};
0044 
0045 #if _LIBCPP_STD_VER >= 17
0046 template <class _Tp, class _Alloc>
0047 inline constexpr bool uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
0048 #endif
0049 
0050 _LIBCPP_END_NAMESPACE_STD
0051 
0052 #endif // _LIBCPP___CXX03___MEMORY_USES_ALLOCATOR_H