Re: class template conflict

2018-12-25 Thread Michelle Long via Digitalmars-d-learn
On Tuesday, 25 December 2018 at 18:34:04 UTC, bauss wrote: On Monday, 24 December 2018 at 00:24:05 UTC, Michelle Long wrote: More simple is : do not use the same identifier ;) The whole point is to use the same identifier ;/ I think there is a bigger problem at stake here in terms of softwa

Re: class template conflict

2018-12-25 Thread Neia Neutuladh via Digitalmars-d-learn
On Tue, 25 Dec 2018 18:34:04 +, bauss wrote: > I think there is a bigger problem at stake here in terms of software > architecture. > > What's the point needed for them to have the same identifier? A probably abstract base class with only one child class. Normally you have "Foo" and "FooImpl

Re: class template conflict

2018-12-25 Thread bauss via Digitalmars-d-learn
On Monday, 24 December 2018 at 00:24:05 UTC, Michelle Long wrote: More simple is : do not use the same identifier ;) The whole point is to use the same identifier ;/ I think there is a bigger problem at stake here in terms of software architecture. What's the point needed for them to have

Re: class template conflict

2018-12-25 Thread Neia Neutuladh via Digitalmars-d-learn
On Tue, 25 Dec 2018 16:55:36 +, Neia Neutuladh wrote: And I forgot part of it. Let's say we did the work to make this function: class X {} template X(int N) { // `: X` somehow refers to the X in the outer scope class X : X {} } How do you distinguish between the

Re: class template conflict

2018-12-25 Thread Neia Neutuladh via Digitalmars-d-learn
On Tue, 25 Dec 2018 13:03:13 +, Michelle Long wrote: > But I am not talking about inside the template being used. The whole > point of doing this is so that one can refer to the base class using the > same name as the derived with a template parameter to make a composite > structure. The follo

Re: class template conflict

2018-12-25 Thread Michelle Long via Digitalmars-d-learn
On Monday, 24 December 2018 at 22:55:55 UTC, Daniel Kozak wrote: ne 23. 12. 2018 13:10 odesílatel Michelle Long via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> napsal: class X { } class X(int N) : X { } Is there any real reason we can't do this? Actually yes. It would break

Re: class template conflict

2018-12-24 Thread Daniel Kozak via Digitalmars-d-learn
ne 23. 12. 2018 13:10 odesílatel Michelle Long via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> napsal: > class X > { > > } > > class X(int N) : X > { > > } > > Is there any real reason we can't do this? Actually yes. It would break almost all of my code. In D you can do thing like

Re: class template conflict

2018-12-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/23/18 7:09 AM, Michelle Long wrote: class X { } class X(int N) : X { } Is there any real reason we can't do this? I think it has less to do with class names and more to do with symbol overloading. The only place I think templates are allowed to overload names with non-templates is

Re: class template conflict

2018-12-23 Thread Michelle Long via Digitalmars-d-learn
More simple is : do not use the same identifier ;) The whole point is to use the same identifier ;/

Re: class template conflict

2018-12-23 Thread Basile B. via Digitalmars-d-learn
On Sunday, 23 December 2018 at 12:09:31 UTC, Michelle Long wrote: class X { } class X(int N) : X { } Is there any real reason we can't do this? It is very nice to be able to treat X like the base and X!n as a derived class. Sure we can do class X(int N) : X!0 { static if(N == 0) {

class template conflict

2018-12-23 Thread Michelle Long via Digitalmars-d-learn
class X { } class X(int N) : X { } Is there any real reason we can't do this? It is very nice to be able to treat X like the base and X!n as a derived class. Sure we can do class X(int N) : X!0 { static if(N == 0) { } } but this is very ugly, in my code I always have to use X!0