return type of Operation -> auto
This commit is contained in:
parent
8ce2f52070
commit
23078a8b2d
3 changed files with 8 additions and 8 deletions
|
@ -631,11 +631,11 @@ namespace MultiArrayTools
|
||||||
|
|
||||||
template <typename T, class OpFunction, class... Ops>
|
template <typename T, class OpFunction, class... Ops>
|
||||||
template <class ET>
|
template <class ET>
|
||||||
inline T Operation<T,OpFunction,Ops...>::get(ET pos) const
|
inline auto Operation<T,OpFunction,Ops...>::get(ET pos) const
|
||||||
{
|
{
|
||||||
typedef std::tuple<Ops...> OpTuple;
|
typedef std::tuple<Ops...> OpTuple;
|
||||||
return PackNum<sizeof...(Ops)-1>::
|
return PackNum<sizeof...(Ops)-1>::
|
||||||
template mkOpExpr<SIZE,T,ET,OpTuple,OpFunction>(mF, pos, mOps);
|
template mkOpExpr<SIZE,ET,OpTuple,OpFunction>(mF, pos, mOps);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, class OpFunction, class... Ops>
|
template <typename T, class OpFunction, class... Ops>
|
||||||
|
|
|
@ -506,7 +506,7 @@ namespace MultiArrayTools
|
||||||
Operation(std::shared_ptr<OpFunction> ff, const Ops&... ops);
|
Operation(std::shared_ptr<OpFunction> ff, const Ops&... ops);
|
||||||
|
|
||||||
template <class ET>
|
template <class ET>
|
||||||
inline T get(ET pos) const;
|
inline auto get(ET pos) const;
|
||||||
|
|
||||||
template <class ET>
|
template <class ET>
|
||||||
inline Operation& set(ET pos);
|
inline Operation& set(ET pos);
|
||||||
|
|
|
@ -70,14 +70,14 @@ namespace MultiArrayHelper
|
||||||
PackNum<N-1>::mkExt(out, siar, second);
|
PackNum<N-1>::mkExt(out, siar, second);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t LAST, typename T, class ETuple, class OpTuple, class OpFunction, typename... Args>
|
template <size_t LAST, class ETuple, class OpTuple, class OpFunction, typename... Args>
|
||||||
static inline T mkOpExpr(std::shared_ptr<OpFunction> f, const ETuple& pos, const OpTuple& ops, Args... args)
|
static inline auto mkOpExpr(std::shared_ptr<OpFunction> f, const ETuple& pos, const OpTuple& ops, Args... args)
|
||||||
{
|
{
|
||||||
typedef typename std::remove_reference<decltype(std::get<N>(ops))>::type NextOpType;
|
typedef typename std::remove_reference<decltype(std::get<N>(ops))>::type NextOpType;
|
||||||
static_assert(LAST >= NextOpType::SIZE, "inconsistent array positions");
|
static_assert(LAST >= NextOpType::SIZE, "inconsistent array positions");
|
||||||
static constexpr size_t NEXT = LAST - NextOpType::SIZE;
|
static constexpr size_t NEXT = LAST - NextOpType::SIZE;
|
||||||
typedef decltype(std::get<N>(ops).get(Getter<NEXT>::template getX<ETuple>( pos ))) ArgT;
|
typedef decltype(std::get<N>(ops).get(Getter<NEXT>::template getX<ETuple>( pos ))) ArgT;
|
||||||
return PackNum<N-1>::template mkOpExpr<NEXT,T,ETuple,OpTuple,OpFunction,ArgT,Args...>
|
return PackNum<N-1>::template mkOpExpr<NEXT,ETuple,OpTuple,OpFunction,ArgT,Args...>
|
||||||
( f, pos, ops, std::get<N>(ops).get(Getter<NEXT>::template getX<ETuple>( pos )), args...);
|
( f, pos, ops, std::get<N>(ops).get(Getter<NEXT>::template getX<ETuple>( pos )), args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,8 +157,8 @@ namespace MultiArrayHelper
|
||||||
std::get<0>(out) = second.rootSteps( std::get<0>(siar) );
|
std::get<0>(out) = second.rootSteps( std::get<0>(siar) );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t LAST, typename T, class ETuple, class OpTuple, class OpFunction, typename... Args>
|
template <size_t LAST, class ETuple, class OpTuple, class OpFunction, typename... Args>
|
||||||
static inline T mkOpExpr(std::shared_ptr<OpFunction> f, const ETuple& pos, const OpTuple& ops, const Args&... args)
|
static inline auto mkOpExpr(std::shared_ptr<OpFunction> f, const ETuple& pos, const OpTuple& ops, const Args&... args)
|
||||||
{
|
{
|
||||||
typedef typename std::remove_reference<decltype(std::get<0>(ops))>::type NextOpType;
|
typedef typename std::remove_reference<decltype(std::get<0>(ops))>::type NextOpType;
|
||||||
static constexpr size_t NEXT = LAST - NextOpType::SIZE;
|
static constexpr size_t NEXT = LAST - NextOpType::SIZE;
|
||||||
|
|
Loading…
Reference in a new issue