ECSTASY
All in the name
Loading...
Searching...
No Matches
can_save_type.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_SERIALIZATION_CAN_SAVE_TYPE_HPP_
13#define ECSTASY_SERIALIZATION_CAN_SAVE_TYPE_HPP_
14
15#include <type_traits>
16
18
20{
21
32 template <typename S, typename T, typename = std::void_t<>>
34
36 template <concepts::is_serializer S, typename T>
37 struct can_save_type<S, T, std::void_t<decltype(std::declval<S &>().save(std::declval<const T &>()))>>
38 : std::true_type {};
39
48 template <concepts::is_serializer S, typename C>
50
60 template <typename S, typename T, typename = std::void_t<>>
62
64 template <typename S, typename T>
65 struct has_save_impl_for_type<S, T, std::void_t<decltype(std::declval<S &>().saveImpl(std::declval<const T &>()))>>
66 : std::true_type {};
67
68 // clang-format off
77 // clang-format on
78 template <typename S, typename C>
80
81} // namespace ecstasy::serialization::traits
82
83#endif /* !ECSTASY_SERIALIZATION_CAN_SAVE_TYPE_HPP_ */
Concept to check if a type is a serializer.
Namespace regrouping the serialization ecstasy type traits.
bool constexpr can_save_type_v
Alias for can_save_type<S, C>::value.
bool constexpr has_save_impl_for_type_v
Alias for has_save_impl_for_type<S, C>::value.
Concept to check if a type can be saved with a serializer.
Concept to check if a serializer has a specific save implementation for a type.