Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Component
- {
- public this(hash_t id)
- {
- this.id = id;
- }
- public hash_t id;
- }
- public class ComponentDetail(T) : Component
- {
- public this()
- {
- super(ID);
- }
- public static hash_t ID = typeid(T).toHash;
- }
- public class AudioComponent : ComponentDetail!AudioComponent
- {
- }
- int main()
- {
- auto pComponent = new AudioComponent();
- writeln(pComponent.getId());
- writeln(AudioComponent.ID);
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement