1#ifndef LIBSBX_CORE_CONCEPTS_HPP_
2#define LIBSBX_CORE_CONCEPTS_HPP_
16template<
typename Callable,
typename Return,
typename... Args>
17concept callable = std::is_invocable_r_v<Return, Callable, Args...>;
19template<
typename Iterable>
20concept iterable =
requires(Iterable iterable) {
21 { Iterable::iterator };
22 { iterable.begin() } -> std::same_as<typename Iterable::iterator>;
23 { iterable.end() } -> std::same_as<typename Iterable::iterator>;
26template<
typename Iterable>
27concept const_iterable =
requires(Iterable iterable) {
28 { Iterable::const_iterator };
29 { iterable.cbegin() } -> std::same_as<typename Iterable::const_iterator>;
30 { iterable.cend() } -> std::same_as<typename Iterable::const_iterator>;
33template<
typename Iterable>
34concept reverse_iterable =
requires(Iterable iterable) {
35 { Iterable::reverse_iterator };
36 { iterable.rbegin() } -> std::same_as<typename Iterable::reverse_iterator>;
37 { iterable.rend() } -> std::same_as<typename Iterable::reverse_iterator>;
Describes a type or object that can be invoked with the give parameters and return the given type.
Definition: concepts.hpp:17