@@ -28,30 +28,21 @@ struct Parser<R, W, Commented<T>, ProcessorsType> {
2828
2929 static Result<Commented<T>> read (const R& _r,
3030 const InputVarType& _var) noexcept {
31- if constexpr (supports_comments<R>) {
32- return Parser<R, W, std::remove_cvref_t <T>, ProcessorsType>::read (_r,
33- _var)
34- .transform ([&](auto && _t) {
35- return Commented<T>(std::move (_t), _r.get_comment (_var));
36- });
37- } else {
38- return Parser<R, W, std::remove_cvref_t <T>, ProcessorsType>::read (_r,
39- _var)
40- .transform ([](auto && _t) {
41- return Commented<T>(std::forward<decltype (_t)>(_t));
42- });
43- }
31+ return Parser<R, W, std::remove_cvref_t <T>, ProcessorsType>::read (_r, _var)
32+ .transform ([](auto && _t) {
33+ return Commented<T>(std::forward<decltype (_t)>(_t));
34+ });
4435 }
4536
4637 template <class P >
4738 static void write (const W& _w, const Commented<T>& _c, const P& _parent) {
39+ Parser<R, W, std::remove_cvref_t <T>, ProcessorsType>::write (_w, _c.get (),
40+ _parent);
4841 if constexpr (supports_comments<W>) {
4942 if (_c.comment ()) {
50- _w. add_comment (_parent , *_c.comment ());
43+ ParentType:: add_comment (_w , *_c.comment (), _parent );
5144 }
5245 }
53- Parser<R, W, std::remove_cvref_t <T>, ProcessorsType>::write (_w, _c.get (),
54- _parent);
5546 }
5647
5748 static schema::Type to_schema (
0 commit comments