prog.cpp:3:12: error: expected unqualified-id before ‘...’ token
struct S { ... }; // Segment tree element type
^~~
prog.cpp:4:13: error: expected primary-expression before ‘...’ token
const S e = ...; // The identity element
^~~
prog.cpp: In function ‘S op(S, S)’:
prog.cpp:5:18: error: expected primary-expression before ‘...’ token
S op(S a, S b) { ... } // Compute a · b
^~~
prog.cpp:5:22: warning: no return statement in function returning non-void [-Wreturn-type]
S op(S a, S b) { ... } // Compute a · b
^
prog.cpp: At global scope:
prog.cpp:7:12: error: expected unqualified-id before ‘...’ token
struct F { ... }; // Lazy mapping type
^~~
prog.cpp:8:14: error: expected primary-expression before ‘...’ token
const F id = ...; // The identity mapping
^~~
prog.cpp: In function ‘S mapping(F, S)’:
prog.cpp:9:23: error: expected primary-expression before ‘...’ token
S mapping(F f, S x) { ... } // Compute f(x)
^~~
prog.cpp:9:27: warning: no return statement in function returning non-void [-Wreturn-type]
S mapping(F f, S x) { ... } // Compute f(x)
^
prog.cpp: In function ‘F composition(F, F)’:
prog.cpp:10:27: error: expected primary-expression before ‘...’ token
F composition(F f, F g) { ... } // Compute f ∘ g
^~~
prog.cpp:10:31: warning: no return statement in function returning non-void [-Wreturn-type]
F composition(F f, F g) { ... } // Compute f ∘ g
^
prog.cpp: In function ‘F inv(F)’:
prog.cpp:11:14: error: expected primary-expression before ‘...’ token
F inv(F f) { ... } // Compute f^(-1)
^~~
prog.cpp:11:18: warning: no return statement in function returning non-void [-Wreturn-type]
F inv(F f) { ... } // Compute f^(-1)
^