Contract-based programming

The goal of this exercise is to identify:

  • the invariant of the String class

  • the pre-condition and the post-condition of its member functions (when applicable)

  • other logical checkpoints both at compile time and run time

and how to express them with static_asserts, asserts and exceptions.