Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Reduce template bloat in std.format #8247

Closed
wants to merge 58 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
f30f22a
Reduce template bloat in std.format
nordlow Sep 10, 2021
ab25acc
Shorten line
nordlow Sep 20, 2021
9b91731
Reduce template bloat when formatting floating point types
nordlow Sep 20, 2021
11a0b28
Change qualifiers
nordlow Sep 20, 2021
14c3a6e
Move TODO of formatValue T template parameter
nordlow Sep 20, 2021
ff83c21
Qualify val as const in formatValueImplBool
nordlow Sep 20, 2021
52c9d30
Use formatValueImplIntegral in formatValueImplBool
nordlow Sep 20, 2021
c0ecea6
Use formatValueImplFloatingPoint for complex parts
nordlow Sep 20, 2021
38738e5
Comment out pragma in formatValue
nordlow Sep 20, 2021
ea1462d
Add formatValueImplChar
nordlow Sep 20, 2021
91d9a1d
Add TODO comment
nordlow Sep 20, 2021
9f75cdc
Add space in cast
nordlow Sep 21, 2021
682f62a
Revert whitespace change
nordlow Sep 22, 2021
5cada95
Qualify parameter formatRange val as auto ref to enable calling it wi…
nordlow Sep 22, 2021
5bee831
Qualify parameter formatRange val as auto ref to enable calling it wi…
nordlow Sep 22, 2021
01f7752
Qualify some function parameters under std.format as const to reduce …
nordlow Sep 10, 2021
45e7763
Add first prel special handling of struct and union with hasToString …
nordlow Sep 22, 2021
da76b8a
Qualify parameter formatObject val as auto ref to enable calling it w…
nordlow Sep 22, 2021
9e87189
Add and call formatValueImplEnum and remove !is(T == enum) from restr…
nordlow Sep 22, 2021
68f0445
Add and use formatValueImplInterface
nordlow Sep 22, 2021
0392d9e
Add and use formatValueImplClass
nordlow Sep 22, 2021
882a143
Remove braces
nordlow Sep 22, 2021
0d3c4e5
Add TODO about const(T) val of formatValue
nordlow Sep 22, 2021
0cdc56d
Add and use formatValueImplNull
nordlow Sep 22, 2021
ca6c164
Add and use formatValueImplPointer
nordlow Sep 22, 2021
e122369
Remove comment
nordlow Sep 22, 2021
b3b1304
Fix comment in formatValue
nordlow Sep 22, 2021
f32b927
Add TODO
nordlow Sep 22, 2021
ea56894
Adjust static assert message
nordlow Sep 22, 2021
e63bb1a
Follow alias this in formatValue
nordlow Sep 22, 2021
84c9c28
Remove comment
nordlow Sep 22, 2021
357ce74
Add comments
nordlow Sep 22, 2021
c72b596
Correct type pattern matching in formatValue
nordlow Sep 23, 2021
1ce4648
Better type names
nordlow Sep 23, 2021
f84b855
Add TODO pragma msg
nordlow Sep 23, 2021
590ff54
Add TODOs
nordlow Sep 23, 2021
323a7ae
Add comment
nordlow Sep 23, 2021
8749d61
Add TODO comments
nordlow Sep 23, 2021
06ede42
Merge remote-tracking branch 'upstream/master' into faster-formatValue
nordlow Sep 23, 2021
dfb32e8
Use ref T val in formatObject
nordlow Sep 23, 2021
2a0440b
Remove pragma
nordlow Sep 23, 2021
cc5e320
Use ref T val in formatRange
nordlow Sep 23, 2021
a47d730
*** empty log message ***
nordlow Sep 23, 2021
06cddd0
Special case void types in formatValue
nordlow Sep 23, 2021
9cf4617
Add prel implementation of AliasThisTypeOf
nordlow Sep 23, 2021
abd8d25
Add BottomAliasThisTypeOf
nordlow Sep 23, 2021
5516d9a
Replace tabs with spaces
nordlow Sep 23, 2021
476ec35
Merge remote-tracking branch 'upstream/master' into faster-formatValue
nordlow Oct 14, 2021
bb48a24
Reduce bloat some more
nordlow Oct 14, 2021
1cb846d
Merge branch 'faster-formatValueImplIntegral' into faster-formatValue
nordlow Oct 16, 2021
0eaeb78
Add comment for formatObject
nordlow Oct 18, 2021
96c7987
Reduce template bloat in IntegralTypeOf-overload of formatValueImpl
nordlow Oct 14, 2021
d6f0d95
Add overloads
nordlow Oct 18, 2021
3691362
Please style-checker
nordlow Oct 18, 2021
d8a6152
Merge branch 'faster-formatValueImplIntegral' into faster-formatValue
nordlow Oct 18, 2021
a642efb
Add some helper traits
nordlow Oct 18, 2021
4afee7e
Align
nordlow Oct 18, 2021
62f8256
Merge remote-tracking branch 'origin/master' into faster-formatValue
nordlow Nov 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use formatValueImplFloatingPoint for complex parts
  • Loading branch information
nordlow committed Sep 20, 2021
commit c0ecea6b9046d89e8dc981c01e415dc6d3af02be
6 changes: 3 additions & 3 deletions std/format/internal/write.d
Original file line number Diff line number Diff line change
Expand Up @@ -1014,12 +1014,12 @@ if (is(immutable T : immutable creal) && !is(T == enum) && !hasToString!(T, Char

immutable creal val = obj;

formatValueImpl(w, val.re, f);
formatValueImplFloatingPoint(w, val.re, f);
if (val.im >= 0)
{
put(w, '+');
}
formatValueImpl(w, val.im, f);
formatValueImplFloatingPoint(w, val.im, f);
put(w, 'i');
}

Expand All @@ -1034,7 +1034,7 @@ if (is(immutable T : immutable ireal) && !is(T == enum) && !hasToString!(T, Char

immutable ireal val = obj;

formatValueImpl(w, val.im, f);
formatValueImplFloatingPoint(w, val.im, f);
put(w, 'i');
}

Expand Down