Daily downloads in decline

Artur Skawina via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 12 13:09:22 PDT 2015


On 06/11/15 23:44, Walter Bright via Digitalmars-d wrote:
> On 6/11/2015 1:18 PM, Meta wrote:
>> It's not *quite* the same. I believe Rust traits are closer to C++ concepts.
> 
> I suspect C++ concepts have the same limitation.

It's not a limitation, but a feature.

Your example could look more or less like this in a
D-with-traits language:

  struct S(InputRange R) {
    ...
    static if (alias fr = ForwardRange!r) {
         R save() {
            auto result = this;
            result.r = fr.save;
            return result;
         }
    }
    ...
  }

IOW the problem can easily be solved, even if Rust and
C++ concepts don't support this functionality.

artur


More information about the Digitalmars-d mailing list