diff --git a/src/lib/util.hpp b/src/lib/util.hpp index 40845283f..1893dda10 100644 --- a/src/lib/util.hpp +++ b/src/lib/util.hpp @@ -201,6 +201,19 @@ namespace util { } + /** compare plain object identity, + * bypassing any custom comparison operators. + */ + template + inline bool + isSameObject (A const& a, B const& b) + { + return static_cast (&a) + == static_cast (&b); + } + + + /** produce an identifier based on the given string. * remove non-standard-chars, reduce sequences of punctuation diff --git a/tests/components/proc/mobject/placement-ref-test.cpp b/tests/components/proc/mobject/placement-ref-test.cpp index 5883b47f1..b8e4a5001 100644 --- a/tests/components/proc/mobject/placement-ref-test.cpp +++ b/tests/components/proc/mobject/placement-ref-test.cpp @@ -28,9 +28,11 @@ #include "proc/mobject/placement-index.hpp" #include "proc/mobject/explicitplacement.hpp" #include "proc/mobject/test-dummy-mobject.hpp" +#include "lib/util.hpp" #include +using util::isSameObject; using lumiera::Time; using std::string; using std::cout; @@ -45,15 +47,6 @@ namespace test { typedef TestPlacement PSub; - template - inline bool - isSameObject (A const& a, B const& b) - { - return static_cast (&a) - == static_cast (&b); - } - - /*************************************************************************** * @test properties and behaviour of the reference-mechanism for Placements. * We create an mock placement index and install it to be used