sstables: convert parse() for a self-describing type to concept

This parse() overload uses "not integral and not enum" to reject
non-self-describing types. Express it directly with the self_describing
concept instead.
This commit is contained in:
Avi Kivity
2021-03-18 18:47:00 +02:00
parent a96b8e8aed
commit bc42aee7c1

View File

@@ -267,8 +267,8 @@ future<> parse(const schema& s, sstable_version_types v, random_access_reader& i
}
// Intended to be used for a type that describes itself through describe_type().
template <class T>
typename std::enable_if_t<!std::is_integral<T>::value && !std::is_enum<T>::value, future<>>
template <self_describing T>
future<>
parse(const schema& s, sstable_version_types v, random_access_reader& in, T& t) {
return t.describe_type(v, [v, &s, &in] (auto&&... what) -> future<> {
return parse(s, v, in, what...);