|
|
|
|
set()
method, you could implement the constructor using it. You just have to setup the members with some initial value. In this case, set()
calls delete[] m_str
, so m_str
must be valid. You can set it to nullptr
since delete
and delete[]
can safely be called with null pointers. Since set()
doesn't use m_len
, you could leave that uninitialized, but I'd initialize it anyway. After all, what if someone changes set()
later on and the new version DOES use m_len
? Your constructor would then break:
|
|
|
|