ECSTASY
All in the name
Loading...
Searching...
No Matches
has_extraction_operator.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_SERIALIZATION_HAS_EXTRACTION_OPERATOR_HPP_
13#define ECSTASY_SERIALIZATION_HAS_EXTRACTION_OPERATOR_HPP_
14
16#include "is_serializer.hpp"
17
19{
32 template <typename S, typename T>
33 concept has_extraction_operator = requires(S &s, const 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<S &>;
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_EXTRACTION_OPERATOR_HPP_ */
Interface for all serializer classes.
Concept to check if a type can be saved with a serializer using the extraction operator.
Concept to check if a type is a serializer.
Namespace regrouping the serialization ecstasy concepts.
bool constexpr has_extraction_operator_v
Alias for has_extraction_operator "has_extraction_operator<S, C>::value".