Suppose I have some constexpr function f:
constexpr int f(int x) { ... }
And I have some const int N known at compile time:
Either<
Here's a more concise answer where you explicitly declare the elements in the original sequence.
#include
constexpr int f(int i) { return 2 * i; }
template
struct sequence
{
using result = sequence;
static std::array apply() { return {{Ts...}}; }
};
using v1 = sequence<1, 2, 3, 4>;
using v2 = typename v1::result;
int main()
{
auto x = v2::apply();
return 0;
}