Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_binary_predicate.hpp
Go to the documentation of this file.
1
// Copyright 2026, Toyota Motor Corporation
2
//
3
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5
#
ifndef
INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_BINARY_PREDICATE_HPP_
6
#
define
INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_BINARY_PREDICATE_HPP_
7
8
// IWYU pragma: private, include "arene/base/type_traits.hpp"
9
// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
11
#
include
"arene/base/stdlib_choice/is_copy_constructible.hpp"
12
#
include
"arene/base/stdlib_choice/is_move_constructible.hpp"
13
#
include
"arene/base/type_traits/is_predicate.hpp"
14
#
include
"arene/base/type_traits/remove_cvref.hpp"
15
// IWYU pragma: no_include "arene/base/stdlib_choice/remove_cv.hpp"
16
// IWYU pragma: no_include "arene/base/stdlib_choice/remove_reference.hpp"
17
18
namespace
arene
{
19
namespace
base
{
20
21
/// @brief determines if a type satisfies the BinaryPredicate named requirement
22
/// @tparam F the possible binary predicate function object
23
/// @tparam T1 type of the first argument
24
/// @tparam T2 type of the second argument
25
///
26
/// BinaryPredicate is a set of requirements expected by some of the standard
27
/// library facilities from the user-provided function object types.
28
///
29
/// Given a BinaryPredicate @c pred and a pair of iterators @c iter1 and
30
/// @c iter2 or an iterator @c iter and a (possibly const) value @c value, the
31
/// type and value category of the expression <c> pred(*iter1, *iter2) </c> or,
32
/// respectively, <c> pred(*iter, value) </c>, must meet the BooleanTestable
33
/// requirements.
34
///
35
/// In addition, evaluation of that expression is not allowed to call non-const
36
/// member functions of the dereferenced iterators; syntactically, the predicate
37
/// must accept const object arguments, with the same behavior regardless of
38
/// whether its arguments are const or non-const.
39
///
40
/// A type satisfies BinaryPredicate if
41
/// * the type satisfies Predicate
42
/// * the type satisfies CopyConstructible
43
///
44
/// @{
45
template
<
class
F
,
class
T1
,
class
T2
=
T1
>
46
extern
constexpr
bool
is_binary_predicate_v
=
//
47
is_predicate_v
<
F
,
T1
,
T2
> &&
48
is_predicate_v
<
49
F
,
50
remove_cvref_t
<
T1
>
const
&,
51
remove_cvref_t
<
T2
>
const
&> &&
52
std
::
is_move_constructible
<
remove_cvref_t
<
F
>>::
value
&&
//
53
std
::
is_copy_constructible
<
remove_cvref_t
<
F
>>::
value
;
54
/// @}
55
56
}
// namespace base
57
}
// namespace arene
58
#
endif
// INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_IS_BINARY_PREDICATE_HPP_
arene::base
Definition
array_exceptions_disabled.cpp:11
arene::base::is_binary_predicate_v
constexpr bool is_binary_predicate_v
determines if a type satisfies the BinaryPredicate named requirement
arene
Copyright 2026, Toyota Motor Corporation.
Definition
array_exceptions_disabled.cpp:10
arene
base
type_traits
is_binary_predicate.hpp
Generated by
1.13.2