ECSTASY
All in the name
Loading...
Searching...
No Matches
has_insertion_operator.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_SERIALIZATION_HAS_INSERTION_OPERATOR_HPP_
13#define ECSTASY_SERIALIZATION_HAS_INSERTION_OPERATOR_HPP_
14
16#include "is_serializer.hpp"
17
19{
32 template <typename S, typename T>
33 concept has_insertion_operator = requires(S &s, T &t) {
34 // Cannot use is_serializer here because it would create a circular dependency.
35 requires std::derived_from<S, ISerializer>;
36
37 // clang-format off
38 { t << s } -> std::same_as<T &>;
39 // clang-format on
40 };
41
42 // clang-format off
52 // clang-format on
53 template <typename S, typename C>
55
56} // namespace ecstasy::serialization::concepts
57
58#endif /* !ECSTASY_SERIALIZATION_HAS_INSERTION_OPERATOR_HPP_ */
Interface for all serializer classes.
Concept to check if a type can be updated with a serializer using the insertion operator.
Concept to check if a type is a serializer.
Namespace regrouping the serialization ecstasy concepts.
bool constexpr has_insertion_operator_v
Alias for has_insertion_operator "has_insertion_operator<S, C>::value".