Skip to content

Commit e27e761

Browse files
authored
[articles/template-comparison] Fix missing arguments to ERROR macro (#3686)
* [articles/template-comparison] Fix missing arguments to ERROR macro * Fix D string param example
1 parent 6bef41b commit e27e761

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/template-comparison.dd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void foo()
466466
$(TD String Parameters)
467467
$(TD Yes:
468468
---
469-
void foo(char[] format)(int i)
469+
void foo(string format)(int i)
470470
{
471471
writefln(format, i);
472472
}
@@ -480,10 +480,10 @@ foo!("i = %s")(3);
480480
$(BR)$(B$(U C++17))$(BR)
481481
Only indirectly:
482482
$(CPPCODE2
483-
template <const char*>
483+
template <const char *str>
484484
struct S {};
485485

486-
S<"Foo"> foo1; $(ERROR A string literal argument is still illegal)
486+
S<"Foo"> foo1; // $(ERROR A string literal argument is still illegal)
487487
const char foo_str[] = "foo";
488488
S<foo_str> foo2; // Literal types are allowed, including arrays.
489489
)
@@ -946,7 +946,7 @@ Macros:
946946
NO1=<td class="compNo"><a href="$1">No</a></td>
947947
D_CODE = <pre class="d_code2">$0</pre>
948948
CPPCODE2 = <pre class="cppcode2">$0</pre>
949-
ERROR = $(RED $(B error))
949+
ERROR = $(RED $(B error) $0)
950950
SUBNAV=$(SUBNAV_ARTICLES)
951951
META_KEYWORDS=D Programming Language, template metaprogramming,
952952
variadic templates, type deduction, dependent base class

0 commit comments

Comments
 (0)