Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
dangling.hpp
Go to the documentation of this file.
1// parasoft-begin-suppress CERT_C-EXP37-a-3 "False positive: The rule does not mention naming all parameters"
2// Copyright 2026, Toyota Motor Corporation
3//
4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
6#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_RANGES_DANGLING_HPP_
7#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_RANGES_DANGLING_HPP_
8
9// IWYU pragma: private, include "arene/base/ranges.hpp"
10// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
11
12namespace arene {
13namespace base {
14
15namespace ranges {
16
17// parasoft-begin-suppress AUTOSAR-A7_1_5-a-2 "Trailing return syntax permitted by A7-1-5 Permit #1 v1.0.0"
18
19/// @brief A type that can be used to indicate that a range is dangling, i.e. that it is not safe to use the range's
20/// iterators or references after the range has been destroyed.
21class dangling {
22 public:
23 /// @brief Default constructor
24 constexpr dangling() noexcept = default;
25
26 // parasoft-begin-suppress AUTOSAR-A13_3_1-a "False Positive: Constrained via SFINAE"
27 /// @brief Implicitly constructible from any argument list
28 /// @tparam Args the types of the arguments to swallow
29 template <typename... Args>
30 // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions) dangling must be implicitly constructible
31 constexpr dangling(Args&&...) noexcept {}
32
33 /// @brief Copy constructor
34 constexpr dangling(dangling const&) noexcept = default;
35
36 /// @brief Move constructor
37 constexpr dangling(dangling&&) noexcept = default;
38
39 /// @brief Copy assignment operator
40 constexpr auto operator=(dangling const&) noexcept -> dangling& = default;
41
42 /// @brief Move assignment operator
43 constexpr auto operator=(dangling&&) noexcept -> dangling& = default;
44 // parasoft-end-suppress AUTOSAR-A13_3_1-a
45
46 /// @brief Destructor
47 ~dangling() noexcept = default;
48};
49// parasoft-end-suppress AUTOSAR-A7_1_5-a-2
50
51} // namespace ranges
52} // namespace base
53} // namespace arene
54
55#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_RANGES_DANGLING_HPP_
constexpr dangling(dangling &&) noexcept=default
Move constructor.
constexpr dangling() noexcept=default
Default constructor.
constexpr dangling(dangling const &) noexcept=default
Copy constructor.
Definition external_vector.hpp:803
Definition accumulate.hpp:37
Definition accumulate.hpp:36