On Friday, 17 July 2015 at 15:47:39 UTC, Roland Hadinger wrote:
Otherwise, I'd use templates and an alias. Maybe this will result in faster code:bool opIndexAssign(bool value, size_t[2] inds) { void impl(bool b)(size_t[2] inds) { static if(b) alias btx = bts; else alias btx = btr; // code from opIndexAssign goes here... // for (size_t i = startBitInd; ... } if( value ) impl!true(inds); else impl!false(inds);
return value; // oops
}