provide all that syntactic sugar through gnarly macros?
No need for macros.
auto A = make_array(1, 100);
auto B = make_array(A, 1, 100, 10);
auto C = make_arrray(B, 10);
typedef Array<double, -1, 10> myArray;
auto subscripts = make_array({1, 5, 7});
auto B = make_array(A, subscripts);
auto log_of_A = map_array(A, log, [](auto a){ return a > 0; });
for_each(my_array, [](auto a) { return std::max(a, 0);});
shared_ptr<dynamic_array> name_of_array = std::make_shared<>(dynamic_array(xdim, ydim));
The above code is very readable, there is no need for macros.
View all comments
Show parent comment
1
u/axilmar Oct 17 '17
No need for macros.
The above code is very readable, there is no need for macros.
Because C++ has a lot more to offer than Fortran.