scope parameter has effect only on pointers?
user1234
user1234 at 12.de
Mon Jun 23 12:32:41 UTC 2025
On Monday, 23 June 2025 at 10:37:58 UTC, Dom DiSc wrote:
> I think scope should not be allowed on basic types, as it has
> no effect and is only confusing.
> I know, it would be needed to enable generic programming, but I
> find a function that can take both an int and an int* suspect
> anyway - this is kind of too generic for my taste.
This is more about the fact that D has a long history when it's
about not checking attributes or storage classes when they are
noop.
The situation toward that problem seems to be better than a few
years ago, however things like
```
struct S
{
pure a = 0;
}
```
are still compilable.
More information about the Digitalmars-d-learn
mailing list