not operator

   
not operator Logical negation operator

  unary-expr  := !  cast-expr  not  cast-expr  

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.

Example

 template<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 Also

and , bool , expression , or , Chapter 3, <ciso646>

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net