Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions std/bitmanip.d
Original file line number Diff line number Diff line change
Expand Up @@ -2231,8 +2231,7 @@ public:
* $(LI $(B %b) which prints the bits as 8-bit byte packets)
* separated with an underscore.
*/
void toString(scope void delegate(const(char)[]) sink,
FormatSpec!char fmt) const
void toString(scope void delegate(const(char)[]) sink, const ref FormatSpec!char fmt) const
{
switch (fmt.spec)
{
Expand Down
3 changes: 1 addition & 2 deletions std/complex.d
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ if (isFloatingPoint!T)
}

/// ditto
void toString(Writer, Char)(scope Writer w,
FormatSpec!Char formatSpec) const
void toString(Writer, Char)(scope Writer w, const ref FormatSpec!Char formatSpec) const
if (isOutputRange!(Writer, const(Char)[]))
{
import std.format : formatValue;
Expand Down
3 changes: 2 additions & 1 deletion std/container/rbtree.d
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,8 @@ assert(equal(rbt[], [5]));
*/
static if (is(typeof((){FormatSpec!(char) fmt; formatValue((const(char)[]) {}, ConstRange.init, fmt);})))
{
void toString(scope void delegate(const(char)[]) sink, FormatSpec!char fmt) const {
void toString(scope void delegate(const(char)[]) sink, const ref FormatSpec!char fmt) const
{
sink("RedBlackTree(");
sink.formatValue(this[], fmt);
sink(")");
Expand Down
13 changes: 7 additions & 6 deletions std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -1189,11 +1189,12 @@ if (distinctFieldNames!(Specs))
*/
void toString(DG)(scope DG sink) const
{
toString(sink, FormatSpec!char());
auto f = FormatSpec!char();
toString(sink, f);
}

/// ditto
void toString(DG, Char)(scope DG sink, FormatSpec!Char fmt) const
void toString(DG, Char)(scope DG sink, const ref FormatSpec!Char fmt) const
{
import std.format : formatElement, formattedWrite, FormatException;
if (fmt.nested)
Expand Down Expand Up @@ -2443,7 +2444,7 @@ Params:
{
import std.format : FormatSpec, formatValue;
// Needs to be a template because of DMD @@BUG@@ 13737.
void toString()(scope void delegate(const(char)[]) sink, FormatSpec!char fmt)
void toString()(scope void delegate(const(char)[]) sink, const ref FormatSpec!char fmt)
{
if (isNull)
{
Expand All @@ -2456,7 +2457,7 @@ Params:
}

// Issue 14940
void toString()(scope void delegate(const(char)[]) @safe sink, FormatSpec!char fmt)
void toString()(scope void delegate(const(char)[]) @safe sink, const ref FormatSpec!char fmt)
{
if (isNull)
{
Expand Down Expand Up @@ -2996,7 +2997,7 @@ Params:
{
import std.format : FormatSpec, formatValue;
// Needs to be a template because of DMD @@BUG@@ 13737.
void toString()(scope void delegate(const(char)[]) sink, FormatSpec!char fmt)
void toString()(scope void delegate(const(char)[]) sink, const ref FormatSpec!char fmt)
{
if (isNull)
{
Expand Down Expand Up @@ -3350,7 +3351,7 @@ Params:
{
import std.format : FormatSpec, formatValue;
// Needs to be a template because of DMD @@BUG@@ 13737.
void toString()(scope void delegate(const(char)[]) sink, FormatSpec!char fmt)
void toString()(scope void delegate(const(char)[]) sink, const ref FormatSpec!char fmt)
{
if (isNull)
{
Expand Down
3 changes: 1 addition & 2 deletions std/uni.d
Original file line number Diff line number Diff line change
Expand Up @@ -2450,8 +2450,7 @@ public:
* $(LI $(B %x) formats the intervals as a [low .. high$(RPAREN) range of lowercase hex characters)
* $(LI $(B %X) formats the intervals as a [low .. high$(RPAREN) range of uppercase hex characters)
*/
void toString(Writer)(scope Writer sink,
FormatSpec!char fmt) /* const */
void toString(Writer)(scope Writer sink, const ref FormatSpec!char fmt) /* const */
{
import std.format : formatValue;
auto range = byInterval;
Expand Down