so I have a piece of code that I am attempting to test. The code is checking that a few vectors (these are elements of structs) are equivalent to known vectors at certain points, however I am running into an issue. When I attempt to compare the vector to the known vector as follows,
assert((class1.getattr().getattr().getVec(key) == {4,3,2,2}))
I get the following error:
assertAll.cpp:105:82: error: could not convert ‘{4,3,2,2}’ from ‘<brace-enclosed initializer list>’ to ‘std::vector<int>’
the rest of the code is all correct, and the lval of the assert is definitely a vector as it should be. I am compiling with the flags, -std=c++11 -Wall -Wextra -pedantic -O in g++. Does anybody know how to fix this? Is there a way to typecast the bracket enclosed initializer list to a vector, or is there a better way to do this?