C++ novice here, it's probably a simple thing, but I am trying to do something like this, I have a class
class Foo
{
private:
Bar m_bar;
}
class Bar
{
explicit Bar(std::string param);
Bar(Bar const &) = delete;
void operator=(Bar const &x) = delete;
}
Foo::Foo()
{
// how do I initialize this?
m_bar = Bar("new value"); // doesn't work as = and copy constructor are deleted
}
I want to initialize m_bar, how do I do it? I am learning C++ coming from Java and these things are hard to understand even after reading/trying to search for answers here.