On Thursday, 5 September 2013 at 13:50:59 UTC, Timon Gehr wrote:
Of course, the code contains a certain amount of duplication I
wouldn't really want to write down, and this could be improved
in D:
struct BodyWorld(N, LV, AV, M, II, CM){
private alias Args = Seq!(N, LV, AV, M, II);
World!(N, Body!Args, Constraint!Args) world;
BodyForceGenerator!Args* forces;
BodySmpEulerIntegrator!Args* integrator;
BodiesBodies!(Args, BF!Args)* detector;
IslandActivationManager!Args* sleep;
SweptBallMotionClamping!(Args, BF!Args)* ccd;
JointManager!Args* joints;
AccumulatedImpulseSolver!(Args, CM)* solver;
}
This actually a pretty good highlight how even simplest
compile-time facilities can make code much more readable and
maintainable. If proxying is all it does, using variadic template
parameters may be even better.
But I tend to agree. I don't see anything inherently wrong with
Rust syntax here other than lacking (not using?) better meta
facilities.