diff --git a/src/proc/mobject/placement-ref.hpp b/src/proc/mobject/placement-ref.hpp index 8bfec1ab2..ae0bf4a42 100644 --- a/src/proc/mobject/placement-ref.hpp +++ b/src/proc/mobject/placement-ref.hpp @@ -51,38 +51,49 @@ namespace mobject { long dummy_; }; - template + template struct HaID; - struct TestA + template + struct HaIndexed { LuidH id_; - HaID const& getID() const; + HaID const& getID() const; + }; + + template + struct HaID : LuidH + { + HaID () : LuidH () {} + HaID (BA const& ref) : LuidH (ref.getID()) {} + }; + + template + struct HaID : HaID + { + HaID () : HaID () {} + HaID (T const& ref) : HaID (ref) {} + }; + + template + inline HaID const& + HaIndexed::getID() const + { + return *(static_cast*> (&id_)); + } + + + struct Base + { + int ii_; + }; + + struct TestA : Base, HaIndexed + { }; struct TestBA : TestA {}; struct TestBB : TestA {}; - - template<> - struct HaID : LuidH - { - HaID () : LuidH () {} - HaID (TestA const& ref) : LuidH (ref.getID()) {} - }; - - template - struct HaID : HaID - { - HaID () : HaID () {} - HaID (T const& ref) : HaID (ref) {} - }; - - inline - HaID const& - TestA::getID() const - { - return *(static_cast*> (&id_)); - } - + /** diff --git a/tests/components/proc/mobject/placement-ref-test.cpp b/tests/components/proc/mobject/placement-ref-test.cpp index d9869e2b0..b2bc57b0d 100644 --- a/tests/components/proc/mobject/placement-ref-test.cpp +++ b/tests/components/proc/mobject/placement-ref-test.cpp @@ -48,10 +48,10 @@ namespace test { using asset::VIDEO; /** @todo WIP a generic hash-index, maybe also usable for assets */ - HaID hahaBB1; + HaID hahaBB1; TestBA bab; - HaID hahaBA1 (bab); + HaID hahaBA1 (bab); ///////////////////////////////TODO (Experimentation)