module pind.samples.ja.special_functions.special_functions_4; import std.stdio; struct S { this(int i) { writeln("Constructing an object"); } this(int i) const { writeln("Constructing a const object"); } this(int i) immutable { writeln("Constructing an immutable object"); } // '共有'キーワードについては、後の章で説明する。 this(int i) shared { writeln("Constructing a shared object"); } } void main() { auto m = S(1); const c = S(2); immutable i = S(3); shared s = S(4); }