File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ $(GNAME TraitsKeyword):
75
75
$(GLINK derivedMembers)
76
76
$(GLINK isSame)
77
77
$(GLINK compiles)
78
+ $(GLINK toType)
78
79
79
80
$(GNAME TraitsArguments):
80
81
$(GLINK TraitsArgument)
@@ -1663,6 +1664,27 @@ void main()
1663
1664
partial specialization allows for.)
1664
1665
)
1665
1666
1667
+ $(H2 $(GNAME toType))
1668
+
1669
+ $(P Takes a single argument, which must evaluate to an expression of type `string`.
1670
+ The contents of the string must correspond to the $(DDSUBLINK abi, name_mangling, mangled contents of a type)
1671
+ that has been seen by the implementation.)
1672
+
1673
+ $(P Only D mangling is supported. Other manglings, such as C++ mangling, are not.)
1674
+
1675
+ $(P The value returned is a type.)
1676
+
1677
+ ---
1678
+ template Type(T) { alias Type = T; }
1679
+
1680
+ Type!(__traits(toType, "i")) j = 3; // j is declared as type `int`
1681
+
1682
+ static assert(is(Type!(__traits(toType, (int*).mangleof)) == int*));
1683
+
1684
+ __traits(toType, "i") x = 4; // x is also declared as type `int`
1685
+ ---
1686
+
1687
+ $(RATIONALE Provides the inverse operation of the $(DDSUBLINK property, mangleof, `.mangleof`) property.)
1666
1688
1667
1689
1668
1690
$(SPEC_SUBNAV_PREV_NEXT version, Conditional Compilation, errors, Error Handling)
You can’t perform that action at this time.
0 commit comments