codekingpro/portable-devtools
114k
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.8//9//===----------------------------------------------------------------------===//10 11#ifndef _LIBCUDACXX___ITERATOR_EMPTY_H12#define _LIBCUDACXX___ITERATOR_EMPTY_H13 14#ifndef __cuda_std__15#include <__config>16#endif // __cuda_std__17 18#include "../cstddef"19#include "../initializer_list"20 21#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)22# pragma GCC system_header23#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)24# pragma clang system_header25#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)26# pragma system_header27#endif // no system header28 29_LIBCUDACXX_BEGIN_NAMESPACE_STD30 31#if _LIBCUDACXX_STD_VER > 1132 33template <class _Cont>34_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY35constexpr auto empty(const _Cont& __c)36noexcept(noexcept(__c.empty()))37-> decltype (__c.empty())38{ return __c.empty(); }39 40template <class _Tp, size_t _Sz>41_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY42constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }43 44template <class _Ep>45_LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_INLINE_VISIBILITY46constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }47 48#endif // _LIBCUDACXX_STD_VER > 1749 50_LIBCUDACXX_END_NAMESPACE_STD51 52#endif // _LIBCUDACXX___ITERATOR_EMPTY_H53 