File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module mir.serde;
1313
1414import mir.functional: naryFun;
1515import mir.reflection;
16+ import std.meta : AliasSeq;
1617import std.traits : TemplateArgsOf, EnumMembers, hasUDA, isAggregateType;
1718
1819version (D_Exceptions)
@@ -653,6 +654,13 @@ version(mir_test) unittest
653654+/
654655alias serdeGetProxy (alias symbol) = TemplateArgsOf! (getUDA! (symbol, serdeProxy))[0 ];
655656
657+ // / Can be applied to @serdeProxy types to make (de)serialization use
658+ // / underlying type through casting. Useful for enums.
659+ enum serdeProxyCast;
660+
661+ // / Equivalent to @serdeProxy!T @serdeProxyCast
662+ alias serdeEnumProxy (T) = AliasSeq! (serdeProxy! T, serdeProxyCast);
663+
656664/+ +
657665Attributes to conditional ignore field during serialization.
658666
You can’t perform that action at this time.
0 commit comments