[OT] Modules dropped out of C++17

Shachar Shemesh via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 9 01:58:18 PDT 2015


On 09/06/15 11:35, "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:

> I agree, I have conventions in my C++ code where member functions and
> free functions shouldn't mix.
>
> But given C++ templates lack of type safety, I'm not surprised that BS
> pushes it.  It also does not solve "std::begin" issues better than a
> method-extension feature would have done.
Actually, that's an important point for D as well.

I would have a considerably less problem with UFCS had it been limited 
only to explicit declaration.

So:
void func( ref A a, int b ) ...

A a;
a.func(12); // Should not compile IMHO

but:
@property void func( ref A a, int b ) ...

should work. Same goes for dropping the () to zero arguments function 
calls. Once that needs to be a conscious decision by the programmer, my 
problems with UFCS are greatly reduced (though, to be fair, not 
completely alleviated).

Shachar


More information about the Digitalmars-d mailing list