cnorxz/src/include/ranges/xpr/xpr_base.cc.h

77 lines
1.4 KiB
C
Raw Normal View History

2022-10-13 19:12:23 +02:00
#ifndef __cxz_xpr_base_cc_h__
#define __cxz_xpr_base_cc_h__
#include "xpr_base.h"
namespace CNORXZ
{
/************
* VXpr *
************/
template <class Xpr>
VXpr<Xpr>::VXpr(const XprInterface<Xpr>& a) :
Xpr(a.THIS())
{}
template <class Xpr>
Uptr<VXprBase> VXpr<Xpr>::copy() const
{
return std::make_unique<VXpr<Xpr>>(*this);
}
template <class Xpr>
2022-10-16 00:55:14 +02:00
SizeT VXpr<Xpr>::vexec(const UPos& mlast, const DPos& last) const
2022-10-13 19:12:23 +02:00
{
return (*this)(mlast, last);
}
template <class Xpr>
2022-10-16 00:55:14 +02:00
SizeT VXpr<Xpr>::vexec() const
2022-10-13 19:12:23 +02:00
{
2022-10-16 00:55:14 +02:00
return (*this)();
2022-10-13 19:12:23 +02:00
}
template <class Xpr>
DPos VXpr<Xpr>::vrootSteps(PtrId ptrId) const
{
return DPos(this->rootSteps(ptrId));
}
/************
* DXpr *
************/
template <class Xpr>
explicit DXpr::DXpr(const Xpr& a) :
ObjHandle<VXprBase>(VXpr<Xpr>(a))
{}
template <class PosT>
2022-10-16 00:55:14 +02:00
inline SizeT DXpr::operator()(const UPos& mlast, const PosT& last) const
2022-10-13 19:12:23 +02:00
{
DPosRef dlast(&last);
return mC->vexec(mlast, dlast);
}
2022-10-16 00:55:14 +02:00
inline SizeT DXpr::operator()() const
2022-10-13 19:12:23 +02:00
{
2022-10-16 00:55:14 +02:00
return mC->vexec();
2022-10-13 19:12:23 +02:00
}
inline DPos DXpr::rootSteps(PtrId ptrId) const
{
return mC->rootSteps(ptrId);
}
template <SizeT N>
inline DPos DXpr::staticRootSteps(PtrId ptrId) const
{
return this->rootSteps(ptrId);
}
}
#endif