@@ -116,9 +116,10 @@ /* [Todo] is there any way to clearnly implement "assert_compiles" and "assert_not_compile"? */ /// Mixing-in the bean constructor for a class -/*mixin*/ template SimpleConstructor() +/*mixin*/ +template SimpleConstructor() { static if( is(typeof(super) == Object) || super.tupleof.length==0 ) this( typeof(this.tupleof) params ) { @@ -172,9 +173,10 @@ } /// Mixing-in the MOST-DERIVED-member-wise comparator for a class -/*mixin*/ template SimpleCompare() +/*mixin*/ +template SimpleCompare() { override bool opEquals(Object rhs_) const { if( auto rhs = cast(typeof(this))rhs_ ) @@ -237,9 +239,10 @@ } /// Mixing-in a simple toString method -/*mixin*/ template SimpleToString() +/*mixin*/ +template SimpleToString() { override string toString() { string str = sprintf!"%s("(typeof(this).stringof); @@ -267,4 +270,14 @@ mixin SimpleToString; } assert_eq( (new Temp(1,"foo",BigInt(42))).toString(), "Temp(1,foo,42)" ); } + +/// Everything is in + +/*mixin*/ +template SimpleClass() +{ + mixin SimpleConstructor; + mixin SimpleCompare; + mixin SimpleToString; +}