File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,10 +45,6 @@ class Literal {
4545
4646 Literal (const std::string& _str) : value_(find_value(_str).value()) {}
4747
48- // / A single-field literal is special because it
49- // / can also have a default constructor.
50- template <ValueType num_fields = num_fields_,
51- typename = std::enable_if_t <num_fields <= 1 >>
5248 Literal () : value_(0 ) {}
5349
5450 ~Literal () = default ;
Original file line number Diff line number Diff line change 1+ #include < chrono>
2+ #include < rfl.hpp>
3+ #include < rfl/json.hpp>
4+
5+ #include " rfl/DefaultIfMissing.hpp"
6+ #include " write_and_read.hpp"
7+
8+ namespace test_duration_default {
9+
10+ struct TestStruct {
11+ std::chrono::seconds duration;
12+ };
13+
14+ TEST (json, test_duration_default) {
15+ const auto test = TestStruct{.duration = std::chrono::seconds (10 )};
16+ write_and_read<rfl::DefaultIfMissing>(
17+ test, R"( {"duration":{"count":10,"unit":"seconds"}})" );
18+ }
19+ } // namespace test_duration_default
You can’t perform that action at this time.
0 commit comments