diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-11-14 16:53:18 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-11-14 16:53:18 +0000 |
commit | 270082a7e126f727437c99ab8403185e9f29244c (patch) | |
tree | a181dca4756dfc7933005cc73946aa65c7ca9fb8 /libstdc++-v3/include/std/concepts | |
parent | d99828eea22b6ae852f993ce8732d686faf63c95 (diff) | |
download | gcc-270082a7e126f727437c99ab8403185e9f29244c.zip gcc-270082a7e126f727437c99ab8403185e9f29244c.tar.gz gcc-270082a7e126f727437c99ab8403185e9f29244c.tar.bz2 |
libstdc++: Implement new predicate concepts from P1716R3
* include/bits/iterator_concepts.h (__iter_concept_impl): Add
comments.
(indirect_relation): Rename to indirect_binary_predicate and adjust
definition as per P1716R3.
(indirect_equivalence_relation): Define.
(indirectly_comparable): Adjust definition.
* include/std/concepts (equivalence_relation): Define.
* testsuite/std/concepts/concepts.callable/relation.cc: Add tests for
equivalence_relation.
From-SVN: r278256
Diffstat (limited to 'libstdc++-v3/include/std/concepts')
-rw-r--r-- | libstdc++-v3/include/std/concepts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libstdc++-v3/include/std/concepts b/libstdc++-v3/include/std/concepts index c4acfd2..e6d405a 100644 --- a/libstdc++-v3/include/std/concepts +++ b/libstdc++-v3/include/std/concepts @@ -334,26 +334,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // [concepts.callable], callable concepts - // [concept.invocable], concept invocable + /// [concept.invocable], concept invocable template<typename _Fn, typename... _Args> concept invocable = is_invocable_v<_Fn, _Args...>; - // [concept.regularinvocable], concept regular_invocable + /// [concept.regularinvocable], concept regular_invocable template<typename _Fn, typename... _Args> concept regular_invocable = invocable<_Fn, _Args...>; - // [concept.predicate], concept predicate + /// [concept.predicate], concept predicate template<typename _Fn, typename... _Args> concept predicate = regular_invocable<_Fn, _Args...> && boolean<invoke_result_t<_Fn, _Args...>>; - // [concept.relation], concept relation + /// [concept.relation], concept relation template<typename _Rel, typename _Tp, typename _Up> concept relation = predicate<_Rel, _Tp, _Tp> && predicate<_Rel, _Up, _Up> && predicate<_Rel, _Tp, _Up> && predicate<_Rel, _Up, _Tp>; - // [concept.strictweakorder], concept strict_weak_order + /// [concept.equiv], concept equivalence_relation + template<typename _Rel, typename _Tp, typename _Up> + concept equivalence_relation = relation<_Rel, _Tp, _Up>; + + /// [concept.strictweakorder], concept strict_weak_order template<typename _Rel, typename _Tp, typename _Up> concept strict_weak_order = relation<_Rel, _Tp, _Up>; |