August 25, 2020
On Tue, Aug 25, 2020 at 2:15 AM Atila Neves via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Sunday, 2 August 2020 at 20:50:14 UTC, Andrei Alexandrescu wrote:
> > (Background: qualifiers were introduced following my horror when I started writing D1 code and saw that strings are represented as char[]. So structs with string members would look like:
> >
> > [...]
>
> Nearly every time I use inout I run into problems. Something doesn't compile, I get annoyed, and switch to templated this. Can anyone tell me what inout does that templated this doesn't?
>

Generates one instance, rather than many. Is a 'hard' function; ie, can by virtual...


August 25, 2020
On Monday, 17 August 2020 at 11:23:04 UTC, Andrei Alexandrescu wrote:
> On 8/14/20 9:35 PM, Timon Gehr wrote:
>> There is this persistent myth that __traits(compiles, ...) is the same as is(typeof(...)) this is not the case and IIRC I have used it to demonstrate that most template constraints in Phobos don't work correctly.
>
> This is a problem as __traits should be a lower-level, seldom-used resort.

__traits(compiles) is not really a trait. Whether an expression is valid or not isn't really metadata of the expression - because in e.g. D, an expression must be valid in order to have metadata. Traits can be wrapped by templates, this can't. Besides these points, it would be nicer syntax to have something like __compiles(expr) instead.
1 2 3 4 5 6
Next ›   Last »