#include #include using triqs::arrays::array; double f(int i) { return i * 10; } int main() { auto F = triqs::arrays::map(std::function(f)); array A(2, 2); A() = 2; array B, C; A() = 2; B = F(A); C = F(2 * A); // works also with expressions of course std::cout << "A = " << A << std::endl; std::cout << "F(A) = " << B << std::endl; std::cout << "F(2*A) = " << C << std::endl; }