1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <array>
class Curve {
private:
// ...
public:
std::array<double, 3> value(double s);
};
template <typename Functor>
class Algorithm {
private:
Functor f;
static const std::size_t n =
std::tuple_size<decltype(f.value(0.))>::value;
std::array<double, n> a;
public:
// ...
};
int main() {
Algorithm<Curve> a;
(void)a;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
clang++ -std=c++11 -O2 -Wall -Wextra -pedantic -pthread main.cpp && ./a.out