File tree 3 files changed +56
-0
lines changed
3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ dplx_target_sources(deeppack
29
29
dp/fwd
30
30
dp/indefinite_range
31
31
dp/layout_descriptor
32
+ dp/macros
32
33
dp/object_def
33
34
dp/tuple_def
34
35
Original file line number Diff line number Diff line change
1
+
2
+ // Copyright Henrik Steffen Gaßmann 2021.
3
+ //
4
+ // Distributed under the Boost Software License, Version 1.0.
5
+ // (See accompanying file LICENSE or copy at
6
+ // https://www.boost.org/LICENSE_1_0.txt)
7
+
8
+ #pragma once
9
+
10
+ #include < dplx/dp/fwd.hpp>
11
+
12
+ // NOLINTBEGIN(modernize-macro-to-enum)
13
+ // NOLINTBEGIN(cppcoreguidelines-macro-usage)
14
+
15
+ #define DPLX_DP_DECLARE_CODEC_SIMPLE (_fq_type ) \
16
+ template <> \
17
+ class dplx ::dp::codec<_fq_type> \
18
+ { \
19
+ using value_type = _fq_type; \
20
+ \
21
+ public: \
22
+ static auto size_of (emit_context &ctx, _fq_type const &value) noexcept \
23
+ -> std::uint64_t; \
24
+ static auto encode (emit_context &ctx, _fq_type const &value) noexcept \
25
+ -> result<void>; \
26
+ static auto decode (parse_context &ctx, _fq_type &outValue) noexcept \
27
+ -> result<void>; \
28
+ }
29
+
30
+ // NOLINTEND(cppcoreguidelines-macro-usage)
31
+ // NOLINTEND(modernize-macro-to-enum)
Original file line number Diff line number Diff line change
1
+
2
+ // Copyright Henrik Steffen Gaßmann 2021.
3
+ //
4
+ // Distributed under the Boost Software License, Version 1.0.
5
+ // (See accompanying file LICENSE or copy at
6
+ // https://www.boost.org/LICENSE_1_0.txt)
7
+
8
+ #include < dplx/dp/macros.hpp>
9
+
10
+ namespace dp_tests
11
+ {
12
+
13
+ namespace
14
+ {
15
+
16
+ class custom_type
17
+ {
18
+ };
19
+
20
+ } // namespace
21
+
22
+ } // namespace dp_tests
23
+
24
+ DPLX_DP_DECLARE_CODEC_SIMPLE (dp_tests::custom_type);
You can’t perform that action at this time.
0 commit comments