I am trying to reproduce the code explained in a textbook about learning c++. The simplest one is given as follows. But it does not compile as expected.
#include<vector>
using namespace std;
struct Storage
{
vector<int> data;
};
Storage GetStorage(vector<int> params)
{
return Storage{ .data=params};
}
Intellisense gives me this error back:
Storege{(<error-type>)<error-constant>}
expected an expression C/C++(29)