I have a data-structure and a processor-class for the data, the data is stacked without pointers for faster SIMD processing:
struct trajectory_data {
float position[3];
float velocity[3];
float acceleration[3];
...
};
class trajectory_processor{
private:
vector<trajectory_data> tdata;
vector<trajectory_data> default_data;
...
};
But I fail to actually add a data-set to the vector, neither of those work:
trajectory_processor::trajectory_processor(){
// gives error: no match for ‘operator=’ in ...
trajectory_data d0();
default_data[0] = d0;
// gives error: no matching function for call to
// ‘std::vector<trajectory_data>::push_back(trajectory_data (&)())
trajectory_data d1();
default_data.push_back(d1);
};
According to push_back reference and C++ vector push_back I assumed this should be easy, but even after several google searches I just can't find any answer.
This project involves cross-coding in html/javascript and I seem to hit a wall like this one every time I switch back to c++, it starts wearing on my nerves.