diff options
| author | Ralf Luther <luther.ralf@gmail.com> | 2019-03-27 20:23:17 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit2@aicp-server-3> | 2019-03-27 20:23:17 +0000 |
| commit | 1ce3a9d272e564b22a1333a1e36a3d3ab7cfab01 (patch) | |
| tree | 391382eadd4fec5bb480f2e8934fa352770221d1 /clang-r353983/include/c++/v1/initializer_list | |
| parent | d1d48b140bafaa8a50107292f5fce95562575765 (diff) | |
| parent | 4f56932d3416ac03f646bc1a611b3135fec2fe08 (diff) | |
Merge "Update prebuilt Clang to r353983." into p9.0HEADp9.0-backupp9.0
Diffstat (limited to 'clang-r353983/include/c++/v1/initializer_list')
| -rw-r--r-- | clang-r353983/include/c++/v1/initializer_list | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/clang-r353983/include/c++/v1/initializer_list b/clang-r353983/include/c++/v1/initializer_list new file mode 100644 index 00000000..6c4493b7 --- /dev/null +++ b/clang-r353983/include/c++/v1/initializer_list @@ -0,0 +1,117 @@ +// -*- C++ -*- +//===----------------------- initializer_list -----------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_INITIALIZER_LIST +#define _LIBCPP_INITIALIZER_LIST + +/* + initializer_list synopsis + +namespace std +{ + +template<class E> +class initializer_list +{ +public: + typedef E value_type; + typedef const E& reference; + typedef const E& const_reference; + typedef size_t size_type; + + typedef const E* iterator; + typedef const E* const_iterator; + + initializer_list() noexcept; // constexpr in C++14 + + size_t size() const noexcept; // constexpr in C++14 + const E* begin() const noexcept; // constexpr in C++14 + const E* end() const noexcept; // constexpr in C++14 +}; + +template<class E> const E* begin(initializer_list<E> il) noexcept; // constexpr in C++14 +template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in C++14 + +} // std + +*/ + +#include <__config> +#include <cstddef> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +namespace std // purposefully not versioned +{ + +#ifndef _LIBCPP_CXX03_LANG + +template<class _Ep> +class _LIBCPP_TEMPLATE_VIS initializer_list +{ + const _Ep* __begin_; + size_t __size_; + + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX11 + initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT + : __begin_(__b), + __size_(__s) + {} +public: + typedef _Ep value_type; + typedef const _Ep& reference; + typedef const _Ep& const_reference; + typedef size_t size_type; + + typedef const _Ep* iterator; + typedef const _Ep* const_iterator; + + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX11 + initializer_list() _NOEXCEPT : __begin_(nullptr), __size_(0) {} + + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX11 + size_t size() const _NOEXCEPT {return __size_;} + + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX11 + const _Ep* begin() const _NOEXCEPT {return __begin_;} + + _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_AFTER_CXX11 + const _Ep* end() const _NOEXCEPT {return __begin_ + __size_;} +}; + +template<class _Ep> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Ep* +begin(initializer_list<_Ep> __il) _NOEXCEPT +{ + return __il.begin(); +} + +template<class _Ep> +inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_AFTER_CXX11 +const _Ep* +end(initializer_list<_Ep> __il) _NOEXCEPT +{ + return __il.end(); +} + +#endif // !defined(_LIBCPP_CXX03_LANG) + +} // std + +#endif // _LIBCPP_INITIALIZER_LIST |
