fold expressions using a function recursively
Unfortunately c++ fold expression supports only binary operators: &quot;any of the following 32 binary operators: + - * / % ^ &amp; | = &lt; &gt; &lt;&lt; &gt;&gt; += -= = /= %= ^= &amp;= |= &lt;&lt;= &gt;&gt;= == != &lt;= &gt;= &amp;&amp; || , . -&gt;*.&quot; So you can't call your custom function in pack expansion without using a wrapper.
But if your function accepts a variadic number of arguments you can use std::apply
static constexpr std::array arr{ 1, 2, 3, 4, 5, 6, 7};

static constexpr auto sum = [](auto&amp;&amp;... items) {
  return (... + items);
};

static constexpr auto accumulate = [](auto&amp;&amp; fn, const auto&amp; u) {
  return std::apply([fn = std::forward&lt;decltype(fn)&gt;(fn)](auto... item) { return fn(item...); }, u);
};

constexpr auto result = accumulate(sum, arr);

Example here.
Otherwise, you can take advantage of the comma operator:
static constexpr std::array arr{ 1, 2, 3, 4, 5, 6, 7};

static constexpr auto accumulate_impl = [](const auto&amp; a, auto init, auto&amp;&amp; fn) {
  return std::apply([fn = std::forward&lt;decltype(fn)&gt;(fn), &amp;init](auto... items) {
    ((void)(init = fn(std::move(init), items)), ...);
    return init;
  }, a);
};

template&lt;class U, std::size_t N&gt;
static constexpr U accumulate(const std::array&lt;U, N&gt;&amp; u) {
  return accumulate_impl(u, U{},  [](auto&amp;&amp; a, auto&amp;&amp; b){return a+b;});
}

static constexpr auto result = accumulate(arr);

Example here.