Skip to content

Commit d9b4cf0

Browse files
Fix static_assert
1 parent bf9340f commit d9b4cf0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

include/rfl/avro/Parser.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "../Generic.hpp"
55
#include "../Tuple.hpp"
6+
#include "../always_false.hpp"
67
#include "../parsing/Parser.hpp"
78
#include "Reader.hpp"
89
#include "Writer.hpp"
@@ -46,19 +47,20 @@ template <class ProcessorsType>
4647
struct Parser<avro::Reader, avro::Writer, Generic, ProcessorsType> {
4748
using InputVarType = typename avro::Reader::InputVarType;
4849

49-
static Result<Generic> read(const avro::Reader &,
50-
const InputVarType &) noexcept {
51-
static_assert(false, "Generics are unsupported in Avro.");
50+
template <class T>
51+
static Result<Generic> read(const avro::Reader &, const T &) noexcept {
52+
static_assert(always_false_v<T>, "Generics are unsupported in Avro.");
5253
return Error("Unsupported");
5354
}
5455

5556
template <class P>
5657
static void write(const avro::Writer &, const Generic &, const P &) noexcept {
57-
static_assert(false, "Generics are unsupported in Avro.");
58+
static_assert(always_false_v<P>, "Generics are unsupported in Avro.");
5859
}
5960

60-
static schema::Type to_schema(std::map<std::string, schema::Type> *) {
61-
static_assert(false, "Generics are unsupported in Avro.");
61+
template <class T>
62+
static schema::Type to_schema(T *) {
63+
static_assert(always_false_v<T>, "Generics are unsupported in Avro.");
6264
return schema::Type{};
6365
}
6466
};

0 commit comments

Comments
 (0)