On Monday, 21 May 2018 at 20:29:26 UTC, Nick Sabalausky
(Abscissa) wrote:
Ouch, and the error message isn't very helpful either. I wonder
what causes this to fail though, and whether it might simply be
a compiler bug?
I'm pretty sure it's intended behavior. Templates are
instantiated in the s
On Monday, 21 May 2018 at 20:22:05 UTC, Nick Sabalausky
(Abscissa) wrote:
On 05/21/2018 12:36 PM, Arredondo wrote:
> One typo:
>
>> 1. Although the alias this means MyType...
>> 2. Although the alias this means MyType...
Sheesh. I stared at this for a bit, thinkking, "But that's the
same thing
On 5/21/18 4:29 PM, Nick Sabalausky (Abscissa) wrote:
On 05/21/2018 01:30 PM, Paul Backus wrote:
I'm not sure making `_data` private is really a good idea. For
example, this only works if `_data` is public:
import std.algorithm;
import std.range;
import std.stdio;
struct MyType
{
auto
On 05/21/2018 01:43 PM, Steven Schveighoffer wrote:
Nice idea, I wonder if the compiler couldn't do this automatically with
alias, however. It already does this in some cases (e.g. string instead
of immutable(char)[]).
This would help solve the problem that error messages aren't going to
get
On 05/21/2018 01:30 PM, Paul Backus wrote:
I'm not sure making `_data` private is really a good idea. For example,
this only works if `_data` is public:
import std.algorithm;
import std.range;
import std.stdio;
struct MyType
{
auto _data = iota(10);
alias _data this;
}
void main()
On 05/21/2018 12:36 PM, Arredondo wrote:
> One typo:
>
>> 1. Although the alias this means MyType...
>> 2. Although the alias this means MyType...
On 05/21/2018 01:43 PM, Steven Schveighoffer wrote:
> The list has two "1." headers.
Looks like the blog software got confused by my multi-paragraph
On 5/21/18 10:48 AM, Mike Parker wrote:
Nick Sabaluasky's first post to the D Blog is a tip on how to create an
aliased type that keeps its name in error messages.
The blog:
https://dlang.org/blog/2018/05/21/complicated-types-prefer-alias-this-over-alias-for-easier-to-read-error-mes
On Monday, 21 May 2018 at 14:48:23 UTC, Mike Parker wrote:
Nick Sabaluasky's first post to the D Blog is a tip on how to
create an aliased type that keeps its name in error messages.
I'm not sure making `_data` private is really a good idea. For
example, this only works if `_data` is public:
On Monday, 21 May 2018 at 14:48:23 UTC, Mike Parker wrote:
Nick Sabaluasky's first post to the D Blog is a tip on how to
create an aliased type that keeps its name in error messages.
Nice. Interestingly, the error message references the wrong type
when trying to access static members:
struct
Nice tip!
One typo:
1. Although the alias this means MyType...
should be
2. Although the alias this means MyType...
Arredondo.
Nick Sabaluasky's first post to the D Blog is a tip on how to
create an aliased type that keeps its name in error messages.
The blog:
https://dlang.org/blog/2018/05/21/complicated-types-prefer-alias-this-over-alias-for-easier-to-read-error-messages/
Reddit:
https://www.reddit.com/r/progra
11 matches
Mail list logo