module pind.samples.ja.templates.templates_1; import std.stdio; void printInParens(T)(T value) { writefln("(%s)", value); } void main() { printInParens(42); // intを使用 printInParens(1.2); // doubleを使用 auto myValue = MyStruct(); printInParens(myValue); // MyStructを使用 } struct MyStruct { string toString() const { return "hello"; } }