This won't do for the same reason: now 'get' is made public so we're back
to the same problem (inverting roles of x and get).
However what about changing the behavior of alias this as follows:
when a member/method x is private, alias x this behaves as if x was not
declared private.
I think this
On Sunday, 19 May 2013 at 14:33:32 UTC, Ali Çehreli wrote:
On 05/19/2013 05:34 AM, Simen Kjaeraas wrote:
Well, there is also opDot:
What is the state of opDot? According to the change log, it has
been introduced as a part of Version D 2.013 Apr 22, 2008
with the note Added opDot, which is
On Wednesday, May 22, 2013 18:18:34 timotheecour wrote:
On Sunday, 19 May 2013 at 14:33:32 UTC, Ali Çehreli wrote:
On 05/19/2013 05:34 AM, Simen Kjaeraas wrote:
Well, there is also opDot:
What is the state of opDot? According to the change log, it has
been introduced as a part of Version
at least 'delete' is in the deprecated table (marked as will be deprecated
some time in the future)
so should opDot then.
On Wed, May 22, 2013 at 11:34 AM, Jonathan M Davis jmdavisp...@gmx.comwrote:
On Wednesday, May 22, 2013 18:18:34 timotheecour wrote:
On Sunday, 19 May 2013 at 14:33:32
On Saturday, 18 May 2013 at 00:12:13 UTC, Timothee Cour wrote:
so in what you suggest, the exact same problem remains with
'get' being
exposed instead of 'x', so the situation didn't improve...
looks like it's impossible to achieve this?
With current implementation of alias this - no. It
On Sat, 18 May 2013 02:12:00 +0200, Timothee Cour
thelastmamm...@gmail.com wrote:
so in what you suggest, the exact same problem remains with 'get' being
exposed instead of 'x', so the situation didn't improve...
looks like it's impossible to achieve this?
Well, there is also opDot:
On 05/19/2013 05:34 AM, Simen Kjaeraas wrote:
Well, there is also opDot:
What is the state of opDot? According to the change log, it has been
introduced as a part of Version D 2.013 Apr 22, 2008 with the note
Added opDot, which is experimental only.
I will keep assuming that opDot does not
On Sunday, 19 May 2013 at 14:33:32 UTC, Ali Çehreli wrote:
On 05/19/2013 05:34 AM, Simen Kjaeraas wrote:
Well, there is also opDot:
What is the state of opDot? According to the change log, it has
been introduced as a part of Version D 2.013 Apr 22, 2008
with the note Added opDot, which is
Will this do?
struct A(T)
{
private T x;
ref T get()
{
return x;
}
alias get this;
}
-
Btw, fun fact. This code crashes 2.063 beta:
struct A(T)
{
private T x;
alias y = x;
alias y this;
}
dmd: aliasthis.c:114: virtual void AliasThis::semantic(Scope*):
Assertion `t' failed.
How to have alias this with an unaccessible member (x below).
Making the member private won't work as it'll disable all operations on
said member.
struct A(T){
T x;
//private T x would prevent alias this from doing anything useful
alias x this;
}
void main(){
auto a=A!int
On Sat, 18 May 2013 01:13:00 +0200, Timothee Cour
thelastmamm...@gmail.com wrote:
How to have alias this with an unaccessible member (x below).
Making the member private won't work as it'll disable all operations on
said member.
struct A(T){
T x;
//private T x would prevent alias
, Timothee Cour
thelastmamm...@gmail.com wrote:
How to have alias this with an unaccessible member (x below).
Making the member private won't work as it'll disable all operations on
said member.
struct A(T){
T x;
//private T x would prevent alias this from doing anything useful
13 matches
Mail list logo