Problem with compiling vectors in terminal

I don’t quite understand the problem here. The codecademy platform compiles and executes the code by itself, so I wanted to check it out in the real terminal and stumbled across an error. The part of the code I have issues is: std::vector even = {2, 4, 6, 8, 10};
the terminal identifies this line as an error and says this:

non-aggregate type ‘std::vector’ cannot be initialized with an initializer list

std::vector even = {2, 4, 6, 8, 10};

Help, how can i solve this?

You can try to add the vector datatype, like std::vector<“datatype”> name = {values};
But then you will probably encounter another error. Depends on your compiler.
“[Error] could not convert ‘{2, 4, 3, 6, 1, 9}’ from ‘’ to ‘std::vector’”
I got this and found out it was from my compiler because is a bug that has been fixed and my compiler is outdated. So, try this out.