[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __ranges / empty_view.h
blobfc08492110f53c196c4f4f73aeea0108958e2f01
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-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___RANGES_EMPTY_VIEW_H
11 #define _LIBCPP___RANGES_EMPTY_VIEW_H
13 #include <__config>
14 #include <__cstddef/size_t.h>
15 #include <__ranges/enable_borrowed_range.h>
16 #include <__ranges/view_interface.h>
17 #include <__type_traits/is_object.h>
19 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20 # pragma GCC system_header
21 #endif
23 _LIBCPP_BEGIN_NAMESPACE_STD
25 #if _LIBCPP_STD_VER >= 20
27 namespace ranges {
28 template <class _Tp>
29 requires is_object_v<_Tp>
30 class empty_view : public view_interface<empty_view<_Tp>> {
31 public:
32 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; }
33 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; }
34 _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; }
35 _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; }
36 _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; }
39 template <class _Tp>
40 inline constexpr bool enable_borrowed_range<empty_view<_Tp>> = true;
42 namespace views {
44 template <class _Tp>
45 inline constexpr empty_view<_Tp> empty{};
47 } // namespace views
48 } // namespace ranges
50 #endif // _LIBCPP_STD_VER >= 20
52 _LIBCPP_END_NAMESPACE_STD
54 #endif // _LIBCPP___RANGES_EMPTY_VIEW_H