On Thu, 17 Jul 2014 22:49:30 +0000, Nordlöw wrote: > AFAIK there is no compile-time variant of interfaces right? > > Why is that? > > Wouldn't it be nice to say something like > > struct SomeRange realize InputRange { > /* implement members of InputRange */ > } > > and then the compiler will statically check that that all members are > implemented correctly. > > I guess this requires some new syntax to describe what an InputRange is. > > Kind of like C++ Concepts.
What benefits would accrue from adding this? Static verification that a structure implements the specified concepts? If so, you can simply do this instead: static assert(isInputRange!SomeRange);