use .empty() instead of checking [0]
cleanup, use references and string vs raw pointers. also make sure that every compiler BUT cl will default to use noexcept