add 'id' function to range base

This commit is contained in:
Christian Zimmermann 2018-11-19 17:00:35 +01:00
parent ef6876adc9
commit 29c0f48f77
2 changed files with 7 additions and 1 deletions

View file

@ -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<char> data() const = 0; // usefull when writing to files, etc...

View file

@ -177,6 +177,10 @@ namespace MultiArrayTools
{
return this != &in;
}
std::intptr_t RangeBase::id() const
{
return reinterpret_cast<std::intptr_t>(this);
}
} // end namespace MultiArrayTools