B
Bob Doe
I have a const static object. What is the right syntax to get a
reference to the std::vector within the std::map variable?:
class MyObj
{
public:
...
std::map<std::string,
std::vector<std::string> > l_;
};
static MyObj obj;
int main()
{
...
const std::vector<std::string> ®exList = obj.l_["key"]; //
compiler error
...
};
reference to the std::vector within the std::map variable?:
class MyObj
{
public:
...
std::map<std::string,
std::vector<std::string> > l_;
};
static MyObj obj;
int main()
{
...
const std::vector<std::string> ®exList = obj.l_["key"]; //
compiler error
...
};