class template conflict

bauss jj_1337 at live.dk
Tue Dec 25 18:34:04 UTC 2018


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 the same identifier?

Clearly the two classes will have two different functions and 
should be named accordingly.

Ex.

class X { ... }

class X(int N) { ... }

Could be something like:

class X { ... }

class XWithArguments { ... }

There is absolutely no point of them having same identifiers 
unless they did the exact same thing and in that case you'd 
probably just not want this anyway.

A solution to this would be something like:

interface X { }

class XWithoutArguments : X { }

class XWithArguments : X { }


More information about the Digitalmars-d-learn mailing list