more on MIndex + operator << for PosTypes

This commit is contained in:
Christian Zimmermann 2022-11-06 22:58:46 +01:00
parent 172110c5de
commit 0197e7db6e
7 changed files with 265 additions and 118 deletions

View file

@ -264,6 +264,7 @@ namespace CNORXZ
template <class F, class... Ops> template <class F, class... Ops>
constexpr decltype(auto) Operation<F,Ops...>::rootSteps(const IndexId<I>& id) const constexpr decltype(auto) Operation<F,Ops...>::rootSteps(const IndexId<I>& id) const
{ {
// !!!
return mOps.rootSteps(id); return mOps.rootSteps(id);
} }

View file

@ -32,6 +32,13 @@ namespace CNORXZ
{ {
return f( g(std::get<Is>(mIPack))... ); return f( g(std::get<Is>(mIPack))... );
} }
template <class... Indices>
template <class G, class F, SizeT... Is>
constexpr decltype(auto) MIndex<Indices...>::accumulate2i(const G& g, const F& f, std::index_sequence<Is...> is) const
{
return f( g(std::get<Is>(mIPack), std::get<Is>(mBlockSizes))... );
}
template <class... Indices> template <class... Indices>
template <SizeT B, SizeT E, class G, class F> template <SizeT B, SizeT E, class G, class F>
@ -40,25 +47,127 @@ namespace CNORXZ
return accumulatei(g, f, mkIndexSequence<B,E>()) return accumulatei(g, f, mkIndexSequence<B,E>())
} }
template <class... Indices>
template <SizeT B, SizeT E, class G, class F>
constexpr decltype(auto) MIndex<Indices...>::accumulate2(const G& g, const F& f) const
{
return accumulate2i(g, f, mkIndexSequence<B,E>())
}
template <class... Indices> template <class... Indices>
template <SizeT... Is> template <SizeT... Is>
constexpr decltype(auto) mkIPack(SizeT pos, std::index_sequence<Is...> is) const constexpr decltype(auto) MIndex<Indices...>::mkIPack(SizeT pos, std::index_sequence<Is...> is) const
{ {
static_assert(sizeof...(Is) == sizeof...(Indices), static_assert(sizeof...(Is) == sizeof...(Indices),
"sequence size does not match number of indices"); "sequence size does not match number of indices");
return std::make_tuple( std::make_shared<Indices>( mRange->sub(Is) )... ); return std::make_tuple( std::make_shared<Indices>( mRange->sub(Is) )... );
//, (pos / std::get<Is>(mBlockSizes) ) % )... );
} }
template <class... Indices> template <class... Indices>
template <SizeT... Is> template <SizeT... Is>
constexpr decltype(auto) mkBlockSizes(std::index_sequence<Is...> is) const inline void MIndex<Indices...>::setIPack(std::index_sequence<Is...> is) const
{
( (std::get<Is>(mIPack) = (IB::mPos / std::get<Is>(mBlockSize)) % std::get<Is>(mIPack)->max() ),... );
}
template <class... Indices>
template <SizeT... Is>
constexpr decltype(auto) MIndex<Indices...>::mkBlockSizes(std::index_sequence<Is...> is) const
{ {
static_assert(sizeof...(Is) == sizeof...(Indices)-1, static_assert(sizeof...(Is) == sizeof...(Indices)-1,
"set lowest block size manually"); "set lowest block size manually");
return Arr<SizeT,sizeof...(Indices)> return std::make_tuple
{ accumulate<Is,sizeof...(Indices)>( [](const auto& i) { return i->max(); }, ( accumulate<Is,sizeof...(Indices)>
[](const auto&... as) { return (as * ...); } ), ( [](const auto& i) { return i->max(); },
1 }; [](const auto&... as) { return (as * ...); } )...,
SPos<1>() );
}
template <class... Indices>
template <SizeT... Is>
constexpr decltype(auto) MIndex<Indices...>::mkPos(std::index_sequence<Is...> is) const
{
return ( (std::get<Is>(mIPack)*std::get<Is>(mBlockSizes)) + ... );
}
template <class... Indices>
template <SizeT I>
inline void MIndex<Indices...>::up()
{
auto& i = std::get<I>(mIPack);
if constexpr(I != 0){
if(i->pos() == i->max()-1){
IB::mPos -= std::get<I>(mBlockSize) * i->pos();
(*i) = 0;
upi<N-1>();
return;
}
}
IB::mPos += std::get<I>(mBlockSize);
++(*i);
}
template <class... Indices>
template <SizeT I>
inline void MIndex<Indices...>::down()
{
auto& i = std::get<I>(mIPack);
if constexpr(I != 0){
if(i->pos() == 0){
(*i) = i->max()-1;
IB::mPos += std::get<I>(mBlockSize) * i->pos();
downi<N-1>();
return;
}
}
IB::mPos -= std::get<I>(mBlockSize);
--(*i);
}
template <class... Indices>
template <SizeT... Is>
inline String MIndex<Indices...>::mkStringMeta(std::index_sequence<Is...> is) const
{
const String blim = "[";
const String elim = "]";
const String dlim = ",";
static_assert(sizeof...(Is) == sizeof...(Indices)-1,
"set last position outside the index pack");
if constexpr(sizeof...(Is) == 0){
return blim + std::get<0>(mIPack)->stringMeta() + elim;
}
else {
return blim +
( ( std::get<Is>(mIPack)->stringMeta() + dlim ) + ... +
std::get<sizeof...(Indices)-1>(mIPack)->stringMeta() )
+ elim;
}
}
template <class... Indices>
template <SizeT... Is>
inline typename MIndex<Indices...>::MetaType MIndex<Indices...>::mkMeta(std::index_sequence<Is...> is) const
{
return std::make_tuple( std::get<Is>(mIPack)->meta()... );
}
template <class... Indices>
template <SizeT I, class Xpr, class F>
constexpr decltype(auto) MIndex<Indices...>::mkIFor(const Xpr& xpr, F&& f) const
{
if constexpr(I == sizeof..(Indices)-1){
return std::get<I>(mIPack)->ifor(xpr,f);
}
else {
return std::get<I>(mIPack)->ifor( mkIFor<I+1>( xpr, f ), f );
}
}
template <SizeT... Is>
inline void ati(const MetaType& meta, std::index_sequence<Is...> is) const
{
( std::get<Is>(mIPack)->at( std::get<Is>(meta) ), ... );
} }
/************** /**************
@ -68,18 +177,19 @@ namespace CNORXZ
template <class... Indices> template <class... Indices>
template <class MRange> template <class MRange>
MIndex<Indices...>::MIndex(const Sptr<MRange>& range, SizeT pos) : MIndex<Indices...>::MIndex(const Sptr<MRange>& range, SizeT pos) :
IndexInterface<MIndex<Indices...>,Tuple<typename Indices::MetaType...>>(pos), IndexInterface<MIndex<Indices...>,Tuple<typename Indices::MetaType...>>(0),
mIPack(mkIPack(IB::mPos, std::make_index_sequence<sizeof...(Indices)>{})), mIPack(mkIPack(IB::mPos, std::make_index_sequence<sizeof...(Indices)>{})),
mBlockSizes(mkBlockSizes(IB::mPos), std::make_index_sequence<sizeof...(Indices)>{}), mBlockSizes(mkBlockSizes(IB::mPos), std::make_index_sequence<sizeof...(Indices)>{}),
mRange(range) mRange(range),
{} {
(*this) = pos;
}
template <class... Indices> template <class... Indices>
MIndex<Indices...>& MIndex<Indices...>::operator()(const Sptr<MIndex>& mi) MIndex<Indices...>& MIndex<Indices...>::operator()(const Sptr<MIndex>& mi)
{ {
sfor_pn<0,sizeof...(Indices)> mIPack = mi.mIPack;
( [&](auto i) { std::get<i>(mIPack) = std::get<i>(indices); return 0; } ); IB::mPos = mkPos(std::make_index_sequence<sizeof...(Indices)>{});
RangeHelper::setIndexPack<sizeof...(Indices)-1>(mIPack, IB::mPos);
return *this; return *this;
} }
@ -87,78 +197,47 @@ namespace CNORXZ
MIndex<Indices...>& MIndex<Indices...>::operator=(SizeT pos) MIndex<Indices...>& MIndex<Indices...>::operator=(SizeT pos)
{ {
IB::mPos = pos; IB::mPos = pos;
RangeHelper::setIndexPack<sizeof...(Indices)-1>(mIPack, pos); setIPack(std::make_index_sequence<sizeof...(Indices)>{});
return *this; return *this;
} }
template <class... Indices> template <class... Indices>
MIndex<Indices...>& MIndex<Indices...>::operator++() MIndex<Indices...>& MIndex<Indices...>::operator++()
{ {
sfor_m<sizeof...(Indices),0> // End state is defined by high-index being end while all other indices are zero
( [&](auto i) { auto& i0 = std::get<0>(mIPack);
auto& si = *std::get<i>( mIPack ); if(i0->pos() != i0->max()){
if(si.last() and i != 0) { si = 0; return true; } up<sizeof...(Indices)-1>();
else { ++si; return false; } }
return false;
} );
++IB::mPos;
return *this; return *this;
} }
template <class... Indices> template <class... Indices>
MIndex<Indices...>& MIndex<Indices...>::operator--() MIndex<Indices...>& MIndex<Indices...>::operator--()
{ {
sfor_m<sizeof...(Indices),0> if(IB::mPos != 0){
( [&](auto i) { down<sizeof...(Indices)-1>();
auto& si = *std::get<i>( mIPack ); }
if(si.first() and i != 0) { si = si.max()-1; return true; }
else { --si; return false; }
return false;
} );
--IB::mPos;
return *this; return *this;
} }
template <class... Indices>
int MIndex<Indices...>::pp(PtrId idxPtrNum)
{
const int tmp = RangeHelper::ppx<sizeof...(Indices)-1>(mIPack, mBlockSizes, idxPtrNum);
IB::mPos += tmp;
return tmp;
}
template <class... Indices>
int MIndex<Indices...>::mm(PtrId idxPtrNum)
{
const int tmp = RangeHelper::mmx<sizeof...(Indices)-1>(mIPack, mBlockSizes, idxPtrNum);
IB::mPos -= tmp;
return tmp;
}
template <class... Indices> template <class... Indices>
String MIndex<Indices...>::stringMeta() const String MIndex<Indices...>::stringMeta() const
{ {
return std::dynamic_pointer_cast<RangeType>( IB::mRangePtr )->stringMeta(IB::mPos); return mkStringMeta(std::make_index_sequence<sizeof...(Indices)-1>{});
} }
template <class... Indices> template <class... Indices>
typename MIndex<Indices...>::MetaType MIndex<Indices...>::meta() const typename MIndex<Indices...>::MetaType MIndex<Indices...>::meta() const
{ {
MetaType metaTuple; return mkMeta(std::make_index_sequence<sizeof...(Indices)>{});
sfor_pn<0,sizeof...(Indices)>
( [&](auto i) { std::get<i>(metaTuple) = std::get<i>(mIPack)->meta(); return 0; } );
return metaTuple;
} }
template <class... Indices> template <class... Indices>
MIndex<Indices...>& MIndex<Indices...>::at(const MetaType& metaPos) MIndex<Indices...>& MIndex<Indices...>::at(const MetaType& metaPos)
{ {
sfor_pn<0,sizeof...(Indices)> ati(metaPos, std::make_index_sequence<sizeof...(Indices)>{});
( [&](auto i) { std::get<i>(mIPack)->at( std::get<i>(metaPos) ); return 0; } ); IB::mPos = mkPos(std::make_index_sequence<sizeof...(Indices)>{});
IB::mPos = sfor_m<sizeof...(Indices),0>
( [&](auto i) { return std::get<i>(mIPack); },
[&](auto a, auto b) {return a->pos() + b*a->max();}, 0 );
return *this; return *this;
} }
@ -176,22 +255,19 @@ namespace CNORXZ
} }
template <class... Indices> template <class... Indices>
SizeT MIndex<Indices...>::getStepSize(SizeT n) template <SizeT I>
decltype(auto) MIndex<Indices...>::stepSize(const IndexId<I>& id) const;
{ {
if(n >= sizeof...(Indices)){ return accumulate2( [](const auto& i, const auto& b) { return i->stepSize(id) * b },
assert(0); [](const auto&... ss) { return ( ss + ... ); });
// throw !!
}
return mBlockSizes[n+1];
} }
/*
template <class... Indices> template <class... Indices>
template <class Exprs> template <class Xpr, class F>
auto MIndex<Indices...>::ifor(SizeT step, Exprs exs) const constexpr decltype(auto) MIndex<Indices...>::ifor(const Xpr& xpr, F&& f) const
{ {
return RangeHelper::mkFor<0>(step, mIPack, mBlockSizes, exs); return mkIFor<0>(xpr, f);
} }
*/
/********************* /*********************
* MRangeFactory * * MRangeFactory *
@ -256,19 +332,7 @@ namespace CNORXZ
template <class... Ranges> template <class... Ranges>
String MRange<Ranges...>::stringMeta(SizeT pos) const String MRange<Ranges...>::stringMeta(SizeT pos) const
{ {
return (begin()+pos).stringMeta();
}
template <class... Ranges>
IndexType MRange<Ranges...>::begin() const
{
}
template <class... Ranges>
IndexType MRange<Ranges...>::end() const
{
} }
template <class... Ranges> template <class... Ranges>
@ -280,14 +344,14 @@ namespace CNORXZ
template <class... Ranges> template <class... Ranges>
const MetaType MRange<Ranges...>::get(SizeT pos) const const MetaType MRange<Ranges...>::get(SizeT pos) const
{ {
return (begin()+pos)->meta();
} }
template <class... Ranges> template <class... Ranges>
SizeT MRange<Ranges...>::getMeta(const MetaType& metaPos) const SizeT MRange<Ranges...>::getMeta(const MetaType& metaPos) const
{ {
assert(0); auto i = begin();
//return RangeHelper::getMeta<sizeof...(Ranges)-1>(mSpace,metaPos); return i.at(metaPos).pos();
} }
/************************ /************************

View file

@ -52,9 +52,6 @@ namespace CNORXZ
SizeT operator*() const; SizeT operator*() const;
SizeT operator->() const; SizeT operator->() const;
int pp(PtrId idxPtrNum);
int mm(PtrId idxPtrNum);
SizeT dim(); SizeT dim();
Sptr<RangeType> range(); Sptr<RangeType> range();
@ -66,13 +63,15 @@ namespace CNORXZ
MIndex& at(const MetaType& metaPos); MIndex& at(const MetaType& metaPos);
template <class Xpr, class F> template <class Xpr, class F>
decltype(auto) ifor(const Xpr& xpr, F&& f) const; constexpr decltype(auto) ifor(const Xpr& xpr, F&& f) const;
private: private:
MIndex() = default; MIndex() = default;
IndexPack mIPack; IndexPack mIPack;
Arr<SizeT,sizeof...(Indices)> mBlockSizes; //Arr<SizeT,sizeof...(Indices)> mBlockSizes;
typedef decltype(mkBlockSizes(std::make_index_sequence<sizeof...(Indices)-1>{})) BlockTuple;
BlockTuple mBlockSizes;
Sptr<RangeType> mRange; Sptr<RangeType> mRange;
// shift to utils: // shift to utils:
@ -87,16 +86,64 @@ namespace CNORXZ
template <class G, class F, SizeT... Is> template <class G, class F, SizeT... Is>
constexpr decltype(auto) accumulatei(const G& g, const F& f, std::index_sequence<Is...> is) const; constexpr decltype(auto) accumulatei(const G& g, const F& f, std::index_sequence<Is...> is) const;
template <class G, class F, SizeT... Is>
constexpr decltype(auto) accumulate2i(const G& g, const F& f, std::index_sequence<Is...> is) const;
template <SizeT B, SizeT E, class G, class F> template <SizeT B, SizeT E, class G, class F>
constexpr decltype(auto) accumulate(const G& g, const F& f) const; constexpr decltype(auto) accumulate(const G& g, const F& f) const;
template <SizeT B, SizeT E, class G, class F>
constexpr decltype(auto) accumulate2(const G& g, const F& f) const;
template <SizeT... Is> template <SizeT... Is>
constexpr decltype(auto) mkIPack(SizeT pos, std::index_sequence<Is...> is) const; constexpr decltype(auto) mkIPack(SizeT pos, std::index_sequence<Is...> is) const;
template <SizeT... Is>
inline void setIPack(std::index_sequence<Is...> is) const;
template <SizeT... Is> template <SizeT... Is>
constexpr decltype(auto) mkBlockSizes(std::index_sequence<Is...> is) const; constexpr decltype(auto) mkBlockSizes(std::index_sequence<Is...> is) const;
template <SizeT... Is>
constexpr decltype(auto) mkPos(std::index_sequence<Is...> is) const;
template <SizeT I>
inline void up();
template <SizeT I>
inline void down();
template <SizeT... Is>
inline String mkStringMeta(std::index_sequence<Is...> is) const;
template <SizeT... Is>
inline MetaType mkMeta(std::index_sequence<Is...> is) const;
template <SizeT I, class Xpr, class F>
constexpr decltype(auto) mkIFor(const Xpr& xpr, F&& f) const;
template <SizeT... Is>
inline void ati(const MetaType& meta, std::index_sequence<Is...> is) const;
}; };
// modified blockSizes; to be used for Slices; can be created from MIndices
template <class MIndexType, class BlockType>
class GMIndex : public MIndexType
{
public:
// override everything that modyfies IB::mPos or uses mBlockSizes!!!
constexpr GMIndex(const MIndexType& mi, const BlockType& b);
template <class Xpr, class F>
constexpr decltype(auto) ifor(const Xpr& xpr, F&& f) const;
private:
BlockType mBlockSizes;
template <SizeT... Is>
constexpr decltype(auto) mkPos(std::index_sequence<Is...> is) const;
};
// NOT THREAD SAVE // NOT THREAD SAVE
template <class... Ranges> template <class... Ranges>

View file

@ -92,20 +92,6 @@ namespace CNORXZ
return mMetaPtr + IB::mPos; return mMetaPtr + IB::mPos;
} }
template <typename MetaType>
Int UIndex<MetaType>::pp(PtrId idxPtrNum)
{
++(*this);
return 1;
}
template <typename MetaType>
Int UIndex<MetaType>::mm(PtrId idxPtrNum)
{
--(*this);
return 1;
}
template <typename MetaType> template <typename MetaType>
String UIndex<MetaType>::stringMeta() const String UIndex<MetaType>::stringMeta() const
{ {

View file

@ -35,9 +35,6 @@ namespace CNORXZ
const MetaType& operator*() const; const MetaType& operator*() const;
const MetaType* operator->() const; const MetaType* operator->() const;
Int pp(PtrId idxPtrNum);
Int mm(PtrId idxPtrNum);
SizeT dim() const; // = 1 SizeT dim() const; // = 1
Sptr<RangeType> range() const; Sptr<RangeType> range() const;

View file

@ -65,11 +65,18 @@ namespace CNORXZ
template <SizeT N> template <SizeT N>
template <class PosT> template <class PosT>
constexpr auto SPos<N>::extend(const PosT& a) const constexpr decltype(auto) SPos<N>::extend(const PosT& a) const
{ {
return MPos<SPos<N>,PosT>(*this,a); return MPos<SPos<N>,PosT>(*this,a);
} }
template <SizeT N>
template <class PosT>
constexpr decltype(auto) SPos<N>::operator<<(const PosT& a) const
{
return extend(a);
}
template <SizeT N> template <SizeT N>
constexpr SPos<N>::operator UPos() const constexpr SPos<N>::operator UPos() const
{ {
@ -121,11 +128,17 @@ namespace CNORXZ
} }
template <class PosT> template <class PosT>
constexpr auto UPos::extend(const PosT& p1) const constexpr decltype(auto) UPos::extend(const PosT& p1) const
{ {
return MPos<UPos,PosT>(*this, p1); return MPos<UPos,PosT>(*this, p1);
} }
template <class PosT>
constexpr decltype(auto) UPos::operator<<(const PosT& a) const
{
return extend(a);
}
/************ /************
* FPos * * FPos *
************/ ************/
@ -160,12 +173,18 @@ namespace CNORXZ
return UPos(mExt * mMap[a.val()]); return UPos(mExt * mMap[a.val()]);
} }
template <class PosT1> template <class PosT>
constexpr auto FPos::extend(const PosT1& a) const constexpr decltype(auto) FPos::extend(const PosT& a) const
{ {
return MPos<FPos,PosT1>(*this,a); return MPos<FPos,PosT1>(*this,a);
} }
template <class PosT>
constexpr decltype(auto) FPos::operator<<(const PosT& a) const
{
return extend(a);
}
/************* /*************
* SFPos * * SFPos *
*************/ *************/
@ -228,11 +247,18 @@ namespace CNORXZ
template <SizeT N, SizeT... Ms> template <SizeT N, SizeT... Ms>
template <class PosT> template <class PosT>
constexpr auto SFPos<N,Ms...>::extend(const PosT& a) const constexpr decltype(auto) SFPos<N,Ms...>::extend(const PosT& a) const
{ {
return MPos<SFPos<N,Ms...>,PosT>(*this,a); return MPos<SFPos<N,Ms...>,PosT>(*this,a);
} }
template <SizeT N, SizeT... Ms>
template <class PosT>
constexpr decltype(auto) SFPos<N,Ms...>::operator<<(const PosT& a) const
{
return extend(a);
}
template <SizeT N, SizeT... Ms> template <SizeT N, SizeT... Ms>
constexpr SFPos<N,Ms...>::operator FPos() const constexpr SFPos<N,Ms...>::operator FPos() const
{ {
@ -317,12 +343,19 @@ namespace CNORXZ
template <class BPosT, class NPosT> template <class BPosT, class NPosT>
template <class PosT> template <class PosT>
constexpr auto MPos<BPosT,NPosT>::extend(const PosT& a) const constexpr decltype(auto) MPos<BPosT,NPosT>::extend(const PosT& a) const
{ {
typedef decltype(mNext.extend(a)) ONPosT; typedef decltype(mNext.extend(a)) ONPosT;
return MPos<BPosT,ONPosT>(*this, mNext.extend(a)); return MPos<BPosT,ONPosT>(*this, mNext.extend(a));
} }
template <class BPosT, class NPosT>
template <class PosT>
constexpr decltype(auto) MPos<BPosT,NPosT>::operator<<(const PosT& a) const
{
return extend(a);
}
/************ /************
* DPos * * DPos *
************/ ************/

View file

@ -30,8 +30,11 @@ namespace CNORXZ
constexpr auto operator()(const UPos& a) const; constexpr auto operator()(const UPos& a) const;
template <class PosT> template <class PosT>
constexpr auto extend(const PosT& a) const; constexpr decltype(auto) extend(const PosT& a) const;
template <class PosT>
constexpr decltype(auto) operator<<(const PosT& a) const;
explicit constexpr operator UPos() const; explicit constexpr operator UPos() const;
}; };
@ -61,8 +64,10 @@ namespace CNORXZ
constexpr UPos operator()(const PosT& a) const; constexpr UPos operator()(const PosT& a) const;
template <class PosT> template <class PosT>
constexpr auto extend(const PosT& a) const; constexpr decltype(auto) extend(const PosT& a) const;
template <class PosT>
constexpr decltype(auto) operator<<(const PosT& a) const;
}; };
class FPos class FPos
@ -88,9 +93,11 @@ namespace CNORXZ
template <class PosT> template <class PosT>
constexpr UPos operator()(const PosT& a) const; constexpr UPos operator()(const PosT& a) const;
template <class PosT1> template <class PosT>
constexpr auto extend(const PosT1& a) const; constexpr decltype(auto) extend(const PosT& a) const;
template <class PosT>
constexpr decltype(auto) operator<<(const PosT& a) const;
}; };
template <SizeT N, SizeT... Ms> template <SizeT N, SizeT... Ms>
@ -116,7 +123,10 @@ namespace CNORXZ
constexpr auto operator()(const UPos& a) const; constexpr auto operator()(const UPos& a) const;
template <class PosT> template <class PosT>
constexpr auto extend(const PosT& a) const; constexpr decltype(auto) extend(const PosT& a) const;
template <class PosT>
constexpr decltype(auto) operator<<(const PosT& a) const;
explicit constexpr operator FPos() const; explicit constexpr operator FPos() const;
}; };
@ -151,7 +161,10 @@ namespace CNORXZ
constexpr auto operator()(const PosT& a) const; constexpr auto operator()(const PosT& a) const;
template <class PosT> template <class PosT>
constexpr auto extend(const PosT& a) const; constexpr decltype(auto) extend(const PosT& a) const;
template <class PosT>
constexpr decltype(auto) operator<<(const PosT& a) const;
}; };
// treat as scalar pos!!! // treat as scalar pos!!!
@ -188,6 +201,9 @@ namespace CNORXZ
template <class PosT> template <class PosT>
inline decltype(auto) extend(const PosT& a) const; inline decltype(auto) extend(const PosT& a) const;
template <class PosT>
inline decltype(auto) operator<<(const PosT& a) const;
}; };
class DPosRef class DPosRef
@ -219,6 +235,9 @@ namespace CNORXZ
template <class PosT> template <class PosT>
inline decltype(auto) extend(const PosT& a) const; inline decltype(auto) extend(const PosT& a) const;
template <class PosT>
inline decltype(auto) operator<<(const PosT& a) const;
}; };
// for common call of extension vector elements // for common call of extension vector elements