class template conflict

Neia Neutuladh neia at ikeran.org
Tue Dec 25 17:01:21 UTC 2018


On Tue, 25 Dec 2018 16:55:36 +0000, 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 base class and the derived class in 
there? You'd have to use typeof(this) and typeof(super) everywhere.

And externally, how do you refer to class X and template X separately? If 
you have a template with an alias parameter and pass X, how do you pass 
class-X and how do you pass template-X?

This is already unpleasant with functions, and there's a way to 
distinguish them.


More information about the Digitalmars-d-learn mailing list