c++ : convert std::map<std::string, double> to std::map<std::string_view, double>

  c++, c++11

Suppose I have a private std::map inside my class std::map<std::string, double>. How can I transform is to std::map<std::string_view, double> to return to the user? I’d like to have the following prototype here

const std::map<std::string_view, double>&
MyClass::GetInternalMap() const;

Source: Windows Questions C++

LEAVE A COMMENT