diff --git a/src/include/ranges/range_base.h b/src/include/ranges/range_base.h index 454584f..92d3d9d 100644 --- a/src/include/ranges/range_base.h +++ b/src/include/ranges/range_base.h @@ -78,6 +78,8 @@ namespace MultiArrayTools bool operator==(const RangeBase& in) const; bool operator!=(const RangeBase& in) const; + std::intptr_t id() const; + virtual std::string stringMeta(size_t pos) const = 0; virtual std::vector data() const = 0; // usefull when writing to files, etc... diff --git a/src/lib/ranges/range_base.cc b/src/lib/ranges/range_base.cc index 26417fa..bfe422e 100644 --- a/src/lib/ranges/range_base.cc +++ b/src/lib/ranges/range_base.cc @@ -177,6 +177,10 @@ namespace MultiArrayTools { return this != ∈ } - + + std::intptr_t RangeBase::id() const + { + return reinterpret_cast(this); + } } // end namespace MultiArrayTools