Kinds of containers

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 21 10:23:15 PDT 2015


On 10/21/2015 10:51 AM, Robert burner Schadek wrote:
> On Wednesday, 21 October 2015 at 14:20:23 UTC, Andrei Alexandrescu wrote:
>> Containers will obey subsets of a nomenclature of primitives.
>
> Just to be crystal clear, something like this?
>
> void fun(Container)(ref Container c) if (hasAppend!Container) {
>      // append stuff to c
> }

Even simpler, hasMethod!(Container, "append") -- Andrei



More information about the Digitalmars-d mailing list