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::s tring,
std::vector<std ::string l_;
};
static MyObj obj;
int main()
{
...
const std::vector<std ::string®exL ist = obj.l_["key"]; //
compiler error
...
};
reference to the std::vector within the std::map variable?:
class MyObj
{
public:
...
std::map<std::s tring,
std::vector<std ::string l_;
};
static MyObj obj;
int main()
{
...
const std::vector<std ::string®exL ist = obj.l_["key"]; //
compiler error
...
};
Comment