The not operator converts its operand to type bool, inverts its value, and returns a bool result. The not keyword is interchangeable with the ! token. Exampletemplate<typename C> typename C::value_type checked_first(const C& c) { if (not c.empty( )) return c[0]; throw std::out_of_range("container is empty"); } See Alsoand, bool, expression, or, Chapter 3, <ciso646> |