On Tuesday, 11 November 2014 at 19:23:39 UTC, Adam Taylor wrote:
Now what i want to do is pass some such container object to
an interface function:
interface MyInterface
{
void filterCollisions(S)(S collisionCandidates)
if(canRemoveFromContainer!S)
}
You can't. This is one of the major
* i apologize in advance, this is my first post -- the code
formatting probably wont turn out so great...
I have a bunch of duck typed interfaces for containers similar
to what you would find in std.range.
i.e.
template isContainer(C)
{
enum bool isContainer = is(typeof(
(inout int =
On Tuesday, 11 November 2014 at 19:23:39 UTC, Adam Taylor wrote:
* i apologize in advance, this is my first post -- the code
formatting probably wont turn out so great...
I have a bunch of duck typed interfaces for containers
similar to what you would find in std.range.
i.e.
template
Not entirly sure of what you asking for,but have you tried
inhertance?
interface Base(C){
/+...+/
}
interface Derived(C):Base!C{
/+...+/
}
No, i'm specifically looking for a solution that is NOT
inheritance based. I've been looking at solutions based on
opDispatch or
No, i'm specifically looking for a solution that is NOT
inheritance based. I've been looking at solutions based on
opDispatch or template mixins -- but so far haven't come up
with anything.
For example in this thread:
On Wednesday, 12 November 2014 at 01:50:07 UTC, Adam Taylor wrote:
Adam Ruppe has an interesting example:
What that does is defer the type work to runtime, so a lot of
type information is lost there too.
The big magic is that the wrapper object is a template,
specialized for the compile