Add a member array_lengthor something similar to classes Curve:
class Curve
{
public:
static constexpr const std::size_t length = 3;
private:
std::array<double,length> a;
};
template<typename ALGORITHM , std::size_t n = ALGORITHM::length>
class Algorithm
{
...
};
, , length. data_length
F, :
template<typename F>
struct length;
template<>
struct length<Curve> : public std::integral_constant<std::size_t,3>
{};
:
template<typename F , std::size_t n = length<F>::value>
struct Algorithm
{
...
};
EDIT: , :
template<typename F , std::size_t N>
void Algorithm<F,N>::execute()
{
_f();
}
.