File indexing completed on 2026-05-03 08:13:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___ITERATOR_EMPTY_H
0011 #define _LIBCPP___ITERATOR_EMPTY_H
0012
0013 #include <__config>
0014 #include <initializer_list>
0015
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 # pragma GCC system_header
0018 #endif
0019
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021
0022 #if _LIBCPP_STD_VER >= 17
0023
0024 template <class _Cont>
0025 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto
0026 empty(const _Cont& __c) noexcept(noexcept(__c.empty())) -> decltype(__c.empty()) {
0027 return __c.empty();
0028 }
0029
0030 template <class _Tp, size_t _Sz>
0031 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty(const _Tp (&)[_Sz]) noexcept {
0032 return false;
0033 }
0034
0035 template <class _Ep>
0036 [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty(initializer_list<_Ep> __il) noexcept {
0037 return __il.size() == 0;
0038 }
0039
0040 #endif
0041
0042 _LIBCPP_END_NAMESPACE_STD
0043
0044 #endif