Path: blob/main/contrib/llvm-project/libcxx/include/__iterator/data.h
35233 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___ITERATOR_DATA_H10#define _LIBCPP___ITERATOR_DATA_H1112#include <__config>13#include <cstddef>14#include <initializer_list>1516#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17# pragma GCC system_header18#endif1920_LIBCPP_BEGIN_NAMESPACE_STD2122#if _LIBCPP_STD_VER >= 172324template <class _Cont>25constexpr _LIBCPP_HIDE_FROM_ABI auto data(_Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {26return __c.data();27}2829template <class _Cont>30constexpr _LIBCPP_HIDE_FROM_ABI auto data(const _Cont& __c) noexcept(noexcept(__c.data())) -> decltype(__c.data()) {31return __c.data();32}3334template <class _Tp, size_t _Sz>35_LIBCPP_HIDE_FROM_ABI constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept {36return __array;37}3839template <class _Ep>40_LIBCPP_HIDE_FROM_ABI constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept {41return __il.begin();42}4344#endif4546_LIBCPP_END_NAMESPACE_STD4748#endif // _LIBCPP___ITERATOR_DATA_H495051