Agustin:

Sorry i clicked the post button :(. The full code is:

I don't see your error with the following code, please give the code that gives the error, so we can fix the compiler bug:


public class Component {
      ////////////////////////////////////////////////////////////
      /// Component's unique id.
      private hash_t id;
      ....
      ////////////////////////////////////////////////////////////
      /// \brief Default constructor.
      ///
      /// \param[in] id   The id of the component
      ////////////////////////////////////////////////////////////
      public this(hash_t id) {
          this.id = id;
          this.active = true;
          this.validated = true;
      }

      ....
}

public class ComponentDetail(T) : Component {
      ////////////////////////////////////////////////////////////
      /// Component's ID as static member.
      public static hash_t ID = typeid(T).toHash;

      ////////////////////////////////////////////////////////////
      /// \brief Default constructor.
      ////////////////////////////////////////////////////////////
      public this() {
          super(ID);
      }
}

private class InputComponent : ComponentDetail!InputComponent {
}

void main() {
      auto pComponent = new InputComponent();

      writeln(pComponent.getId());
      writeln(InputComponent.ID);
}



Bye,
bearophile

Reply via email to