Warning, /include/c++/v1/initializer_list is written in an unsupported language. File is not indexed.
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_INITIALIZER_LIST
0011 #define _LIBCPP_INITIALIZER_LIST
0012
0013 /*
0014 initializer_list synopsis
0015
0016 namespace std
0017 {
0018
0019 template<class E>
0020 class initializer_list
0021 {
0022 public:
0023 typedef E value_type;
0024 typedef const E& reference;
0025 typedef const E& const_reference;
0026 typedef size_t size_type;
0027
0028 typedef const E* iterator;
0029 typedef const E* const_iterator;
0030
0031 initializer_list() noexcept; // constexpr in C++14
0032
0033 size_t size() const noexcept; // constexpr in C++14
0034 const E* begin() const noexcept; // constexpr in C++14
0035 const E* end() const noexcept; // constexpr in C++14
0036 };
0037
0038 template<class E> const E* begin(initializer_list<E> il) noexcept; // constexpr in C++14
0039 template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in C++14
0040
0041 } // std
0042
0043 */
0044
0045 #if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0046 # include <__cxx03/initializer_list>
0047 #else
0048 # include <__config>
0049 # include <__cstddef/size_t.h>
0050 # include <version>
0051
0052 # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0053 # pragma GCC system_header
0054 # endif
0055
0056 namespace std // purposefully not versioned
0057 {
0058
0059 # ifndef _LIBCPP_CXX03_LANG
0060
0061 template <class _Ep>
0062 class _LIBCPP_TEMPLATE_VIS initializer_list {
0063 const _Ep* __begin_;
0064 size_t __size_;
0065
0066 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
0067 : __begin_(__b),
0068 __size_(__s) {}
0069
0070 public:
0071 typedef _Ep value_type;
0072 typedef const _Ep& reference;
0073 typedef const _Ep& const_reference;
0074 typedef size_t size_type;
0075
0076 typedef const _Ep* iterator;
0077 typedef const _Ep* const_iterator;
0078
0079 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {}
0080
0081 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 size_t size() const _NOEXCEPT { return __size_; }
0082
0083 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin() const _NOEXCEPT { return __begin_; }
0084
0085 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end() const _NOEXCEPT { return __begin_ + __size_; }
0086 };
0087
0088 template <class _Ep>
0089 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* begin(initializer_list<_Ep> __il) _NOEXCEPT {
0090 return __il.begin();
0091 }
0092
0093 template <class _Ep>
0094 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initializer_list<_Ep> __il) _NOEXCEPT {
0095 return __il.end();
0096 }
0097
0098 # endif // !defined(_LIBCPP_CXX03_LANG)
0099
0100 } // namespace std
0101
0102 # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0103 # include <cstddef>
0104 # endif
0105 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0106
0107 #endif // _LIBCPP_INITIALIZER_LIST