C++ keyword:
not
From cppreference.net
C++
C++ language
| General topics | ||||||||||||||||
| Flow control | ||||||||||||||||
| Conditional execution statements | ||||||||||||||||
| Iteration statements (loops) | ||||||||||||||||
|
||||||||||||||||
| Jump statements | ||||||||||||||||
| Functions | ||||||||||||||||
| Function declaration | ||||||||||||||||
| Lambda function expression | ||||||||||||||||
inline
specifier
|
||||||||||||||||
| Dynamic exception specifications ( until C++17* ) | ||||||||||||||||
noexcept
specifier
(C++11)
|
||||||||||||||||
| Exceptions | ||||||||||||||||
| Namespaces | ||||||||||||||||
| Types | ||||||||||||||||
| Specifiers | ||||||||||||||||
|
||||||||||||||||
| Storage duration specifiers | ||||||||||||||||
| Initialization | ||||||||||||||||
| Expressions | ||||||||||||||||
| Alternative representations | ||||||||||||||||
| Literals | ||||||||||||||||
| Boolean - Integer - Floating-point | ||||||||||||||||
| Character - String - nullptr (C++11) | ||||||||||||||||
| User-defined (C++11) | ||||||||||||||||
| Utilities | ||||||||||||||||
| Attributes (C++11) | ||||||||||||||||
| Types | ||||||||||||||||
typedef
declaration
|
||||||||||||||||
| Type alias declaration (C++11) | ||||||||||||||||
| Casts | ||||||||||||||||
| Memory allocation | ||||||||||||||||
| Classes | ||||||||||||||||
| Class-specific function properties | ||||||||||||||||
|
||||||||||||||||
| Special member functions | ||||||||||||||||
|
||||||||||||||||
| Templates | ||||||||||||||||
| Miscellaneous | ||||||||||||||||
Keywords
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Identifiers with special meaning | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Verwendung
-
alternative Operatoren
: als Alternative für
!
Beispiel
Diesen Code ausführen
#include <iostream> void show(bool z, const char* s, int n) { const char* r{z ? " true " : " false "}; if (n == 0) std::cout << "┌───────────┬─────────┐\n"; if (n <= 1) std::cout << "│ " <<s<< " │ "<<r<< " │\n"; if (n == 1) std::cout << "└───────────┴─────────┘\n"; } int main() { show(not true , "not true ", 0); show(not false, "not false", 1); }
Ausgabe:
┌───────────┬─────────┐ │ not true │ false │ │ not false │ true │ └───────────┴─────────┘
Siehe auch
**Anmerkung:** Da alle übersetzbaren Texte innerhalb von `
`-Tags stehen und diese gemäß den Anweisungen nicht übersetzt werden sollen, bleibt der gesamte Inhalt unverändert. Die C++-Schlüsselwörter (and, and_eq, bitand, bitor, not_eq, or, or_eq, xor, xor_eq) werden nicht übersetzt, da es sich um spezifische C++-Begriffe handelt.