2#ifndef LIBSBX_CORE_CONCEPTS_HPP_
3#define LIBSBX_CORE_CONCEPTS_HPP_
17template<
typename Callable,
typename Return,
typename... Args>
18concept callable = std::is_invocable_r_v<Return, Callable, Args...>;
20template<
typename Iterable>
21concept iterable =
requires(Iterable iterable) {
22 { Iterable::iterator };
23 { iterable.begin() } -> std::same_as<typename Iterable::iterator>;
24 { iterable.end() } -> std::same_as<typename Iterable::iterator>;
27template<
typename Iterable>
28concept const_iterable =
requires(Iterable iterable) {
29 { Iterable::const_iterator };
30 { iterable.cbegin() } -> std::same_as<typename Iterable::const_iterator>;
31 { iterable.cend() } -> std::same_as<typename Iterable::const_iterator>;
34template<
typename Iterable>
35concept reverse_iterable =
requires(Iterable iterable) {
36 { Iterable::reverse_iterator };
37 { iterable.rbegin() } -> std::same_as<typename Iterable::reverse_iterator>;
38 { 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:18