pos_type: more constexpr
This commit is contained in:
parent
d997de17a8
commit
bcdbb12b4c
2 changed files with 15 additions and 2 deletions
src/include/xpr
|
@ -288,7 +288,8 @@ namespace CNORXZ
|
|||
static constexpr decltype(auto) mks(const PosT& pos, std::index_sequence<Is...> is)
|
||||
{
|
||||
if constexpr(is_static_pos_type<PosT>::value){
|
||||
return SFPos<pos.val(),Is...> {};
|
||||
constexpr PosT posx;
|
||||
return SFPos<posx.val(),Is...> {};
|
||||
}
|
||||
else {
|
||||
return mk(pos, &SFPos<0,Is...>::permutation[0]);
|
||||
|
@ -838,12 +839,21 @@ namespace CNORXZ
|
|||
return std::get<I>(mP);
|
||||
}
|
||||
|
||||
template <class BPosT, class... OPosTs>
|
||||
template <SizeT I>
|
||||
constexpr decltype(auto) EPos<BPosT,OPosTs...>::constexprget(CSizeT<I> i) const
|
||||
{
|
||||
constexpr decltype(std::get<I>(mP).val()) x;
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class BPosT, class... OPosTs>
|
||||
template <SizeT... Is>
|
||||
constexpr decltype(auto) EPos<BPosT,OPosTs...>::ival(std::index_sequence<Is...> is) const
|
||||
{
|
||||
if constexpr(is_static_pos_type<EPos<BPosT,OPosTs...>>::value){
|
||||
return std::index_sequence<std::get<Is>(mP).val()...>{};
|
||||
//return std::index_sequence<std::get<Is>(mP).val()...>{};
|
||||
return std::index_sequence<constexprget(CSizeT<Is>{})...>{};
|
||||
}
|
||||
else {
|
||||
return Arr<SizeT,is.size()> { (BPosT::val()+std::get<Is>(mP).val())... };
|
||||
|
|
|
@ -286,6 +286,9 @@ namespace CNORXZ
|
|||
private:
|
||||
Tuple<OPosTs...> mP;
|
||||
|
||||
template <SizeT I>
|
||||
constexpr decltype(auto) constexprget(CSizeT<I> i) const;
|
||||
|
||||
template <SizeT... Is>
|
||||
constexpr decltype(auto) ival(std::index_sequence<Is...> is) const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue