The objective of this exercise is to learn the basics of RAII, the most important pilar of C++. To do so, you must implement an inmutable string class, which works as follows:
- The class belongs to the first module of the project,
containers
. - Can be initialized from a C null terminated string (
const char*
). - Manages its own copy in memory of the string given to the constructor.
- The underlying string storage is correctly handled (Released when it needs to, copied when it needs to, etc).
- The class has no mutable operations, so the underlying storage is modified only in initialization/copy/move/destruction operations.