Hello, I am trying to use STL vector container to store a set of fixed dimension arrays. Everything works fine until I try to push_back() new values.
in code terms
C-style arrays are idiosyncratic in that they don't support value semantics.
Use instead the standard array wrapper std::array.
1 2 3
# include <array>
typedef std::array<std::array<ctensor, 2>, 2> dcomp; // or
// using dcomp = std::array<std::array<ctensor, 2>, 2>;
std::array is like a C-style array (it is an aggregate type), except that it does not discard type information and it can be copied and assigned in the natural way. It should be preferred over an a built-in array whenever required.
(IMO, Built-in arrays are one of the worst language features in C++. Library support is required to make their widespread use viable in most modern code.)