From 691a9ed886b08fa9ba32f9ceda0f250207da89f6 Mon Sep 17 00:00:00 2001 From: Ilya Yaroshenko Date: Fri, 24 Sep 2021 20:07:13 +0700 Subject: [PATCH 1/2] Revert "Use const parameters in mir.format to reduce template bloat (#359)" This reverts commit 9a6abda64b9c16f920958a1f8c0e6cb7b58b2117. --- source/mir/format.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mir/format.d b/source/mir/format.d index 0e31448f..a4fed192 100644 --- a/source/mir/format.d +++ b/source/mir/format.d @@ -60,7 +60,7 @@ unittest } /// Concatenated string results -string text(string separator = "", Args...)(auto ref const(Args) args) +string text(string separator = "", Args...)(auto ref Args args) if (Args.length > 0) { static if (Args.length == 1) From d3ac8036252b993197aef02680e33ed6f147c18b Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2021 20:10:34 +0700 Subject: [PATCH 2/2] add test --- source/mir/format.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/mir/format.d b/source/mir/format.d index a4fed192..b8f02524 100644 --- a/source/mir/format.d +++ b/source/mir/format.d @@ -88,7 +88,8 @@ string text(string separator = "", Args...)(auto ref Args args) /// @safe pure nothrow unittest { - assert(text("str ", true, " ", 100, " ", 124.1) == "str true 100 124.1", text("str ", true, " ", 100, " ", 124.1)); + const i = 100; + assert(text("str ", true, " ", i, " ", 124.1) == "str true 100 124.1", text("str ", true, " ", 100, " ", 124.1)); assert(text!" "("str", true, 100, 124.1) == "str true 100 124.1"); }