Back to home page

EIC code displayed by LXR

 
 

    


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

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___ITERATOR_DATA_H
0011 #define _LIBCPP___ITERATOR_DATA_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 constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {
0026   return __c.data();
0027 }
0028 
0029 template <class _Cont>
0030 constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {
0031   return __c.data();
0032 }
0033 
0034 template <class _Tp, size_t _Sz>
0035 _LIBCPP_HIDE_FROM_ABI constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept {
0036   return __array;
0037 }
0038 
0039 template <class _Ep>
0040 _LIBCPP_HIDE_FROM_ABI constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept {
0041   return __il.begin();
0042 }
0043 
0044 #endif
0045 
0046 _LIBCPP_END_NAMESPACE_STD
0047 
0048 #endif // _LIBCPP___ITERATOR_DATA_H