range pack: add explicit cast to YRange Ptr

This commit is contained in:
Christian Zimmermann 2025-01-28 17:18:44 -08:00
parent a886cd0636
commit 70358e4233
2 changed files with 9 additions and 1 deletions

View file

@ -247,6 +247,9 @@ namespace CNORXZ
/** return YRange containig the ranges of the pack */
operator RangePtr() const;
/** return YRange containig the ranges of the pack */
operator Sptr<YRange>() const;
};
/** create a pack consisting of ranges a and b

View file

@ -118,7 +118,12 @@ namespace CNORXZ
{
return YRangeFactory(mRs).create();
}
RangePack::operator Sptr<YRange>() const
{
return std::dynamic_pointer_cast<YRange>( YRangeFactory(mRs).create() );
}
RangePack operator*(const RangePtr& a, const RangePtr& b)
{
CXZ_ASSERT(a != nullptr, "first operand not initialized");