prog.cpp:1:1: error: ‘vector’ does not name a type
vector<valarray<int>> generate_3d_topology(int window) {
^~~~~~
prog.cpp:13:1: error: ‘valarray’ does not name a type
valarray<int> get_3d_indices(const valarray<int>& base, const valarray<int>& shift) {
^~~~~~~~
prog.cpp:17:29: error: ‘valarray’ does not name a type
bool indices_in_range(const valarray<int>& indices, const valarray<int>& sizes) {
^~~~~~~~
prog.cpp:17:37: error: expected ‘,’ or ‘...’ before ‘<’ token
bool indices_in_range(const valarray<int>& indices, const valarray<int>& sizes) {
^
prog.cpp: In function ‘bool indices_in_range(int)’:
prog.cpp:18:10: error: ‘size_t’ was not declared in this scope
for (size_t i = 0; i < indices.size(); ++i) {
^~~~~~
prog.cpp:18:24: error: ‘i’ was not declared in this scope
for (size_t i = 0; i < indices.size(); ++i) {
^
prog.cpp:18:28: error: ‘indices’ was not declared in this scope
for (size_t i = 0; i < indices.size(); ++i) {
^~~~~~~
prog.cpp:19:45: error: ‘sizes’ was not declared in this scope
if (indices[i] < 0 || indices[i] >= sizes[i]) {
^~~~~
prog.cpp: At global scope:
prog.cpp:27:1: error: ‘tuple’ does not name a type
tuple<int, int, int> unpack_indices(const valarray<int>& indices) {
^~~~~
prog.cpp:32:33: error: ‘valarray’ does not name a type
void iterate_3d_neighbors(const valarray<int>& base, int window, const valarray<int>& sizes, Lambda lambda) {
^~~~~~~~
prog.cpp:32:41: error: expected ‘,’ or ‘...’ before ‘<’ token
void iterate_3d_neighbors(const valarray<int>& base, int window, const valarray<int>& sizes, Lambda lambda) {
^
prog.cpp: In function ‘void iterate_3d_neighbors(int)’:
prog.cpp:33:42: error: ‘window’ was not declared in this scope
auto topology = generate_3d_topology(window);
^~~~~~
prog.cpp:33:48: error: there are no arguments to ‘generate_3d_topology’ that depend on a template parameter, so a declaration of ‘generate_3d_topology’ must be available [-fpermissive]
auto topology = generate_3d_topology(window);
^
prog.cpp:33:48: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
prog.cpp:35:48: error: ‘base’ was not declared in this scope
auto neighbor_indices = get_3d_indices(base, neighbor);
^~~~
prog.cpp:36:49: error: ‘sizes’ was not declared in this scope
if (!indices_in_range(neighbor_indices, sizes)) {
^~~~~
prog.cpp:39:14: error: expected unqualified-id before ‘[’ token
auto [x, y, z] = unpack_indices(neighbor_indices);
^
prog.cpp:40:16: error: ‘x’ was not declared in this scope
lambda(x, y, z);
^
prog.cpp:40:19: error: ‘y’ was not declared in this scope
lambda(x, y, z);
^
prog.cpp:40:22: error: ‘z’ was not declared in this scope
lambda(x, y, z);
^
prog.cpp:40:23: error: there are no arguments to ‘lambda’ that depend on a template parameter, so a declaration of ‘lambda’ must be available [-fpermissive]
lambda(x, y, z);
^
prog.cpp: At global scope:
prog.cpp:44:1: error: expected unqualified-id before ‘...’ token
...
^~~
prog.cpp:48:18: error: expected unqualified-id before ‘,’ token
{1, 5, 7},
^
prog.cpp:49:9: error: expected unqualified-id before numeric constant
4,
^
prog.cpp:50:21: error: expected unqualified-id before ‘,’ token
{10, 10, 10},
^
prog.cpp:51:9: error: expected unqualified-id before ‘[’ token
[v](int x, int y, int z) {
^
prog.cpp:53:10: error: expected unqualified-id before ‘)’ token
});
^