I have a class that looks like this
class MyCalss
{
public:
std::unordered_map<std::string, std::unique_ptr<Entity>> getMyMap() const;
private:
std::unordered_map<std::string, std::unique_ptr<Entity>> m_myMap;
}
In the implementation, I simple return m_myMap in getMyMap() like so,
std::unordered_map<std::string, std::unique_ptr<Entity>> MyClass::getMyMap() const
{
return m_myMap;
}
How come this is not allowed? I get a bunch of compilation error doing this.