The "Unknown:"s below indicate that an entry is incomplete.
{ ... }(1) | block (grouping statements, especially when statements are not expressions) |
nothing needed | breaking lines (useful when end-of-line and/or indentation has a special meaning) |
/* ... */ | commenting (non nestable) |
// | commenting (until end of line) |
< > <= >= | comparison |
min / max | comparison (min / max (binary or more)) |
== != | equality / inequality (deep) |
== != | equality / inequality (shallow) |
( ... ) | grouping expressions |
__LINE__ __FILE__ | information about the current line and file |
case-sensitive | tokens (case-sensitivity (keywords, variable identifiers...)) |
[_a-zA-Z][_a-zA-Z0-9]* | tokens (variable identifier regexp) |
usually underscores | tokens (what is the standard way for scrunching together multiple words) |
= | variable assignment or declaration (assignment) |
t v | variable assignment or declaration (declaration) |
Unknown:
documentation comment
f(a,b,...) | function call |
f() | function call (with no parameter) |
typ0 f(typ1 para1, typ2 para2, ...) { ... } | function definition |
void f(typ1 para1, typ2 para2, ...) { ... } | function definition (procedures) |
one can use overloading on different number of arguments | function definition (variable number of arguments) |
return(2) | function return value (breaks the control flow) |
continue / break | breaking control flow (continue / break) |
goto | breaking control flow (goto (unconditional jump)) |
return(2) | breaking control flow (returning a value) |
try a catch (exn) ... | exception (catching) |
throw | exception (throwing) |
if (c) ... | if_then |
if (c) b1 else b2 | if_then_else |
c ? b1 : b2 | if_then_else |
do ... while (!c) | loop (do something until condition) |
for | loop (for "a la C" (while + initialisation)) |
for (int i = 10; i >= 1; i--) ... | loop (for each value in a numeric range, 1 decrement) |
for (int i = 1; i <= 10; i++) ... | loop (for each value in a numeric range, 1 increment (see also the entries about ranges)) |
for (int i = 1; i <= 10; i += 2) ... | loop (for each value in a numeric range, free increment) |
while (c) ... | loop (while condition do something) |
switch (val) { case v1: ...; break; case v2: case v3: ...; break; default: ...; } | multiple selection (switch) |
, | sequence |
; | sequence |
t v | annotation (or variable declaration) |
(t) e | cast (computed conversion (calls an internal or a user-defined function)) |
t(e) | cast (computed conversion (calls an internal or a user-defined function)) |
dynamic_cast<t>(e) | cast (downcast (need runtime checking)) |
(t) e | cast (upcast) |
static_cast<t>(e) | cast (upcast) |
typedef t n | declaration |
const T | mutability, constness (type of a constant value) |
mutability is the default | mutability, constness (type of a mutable value) |
class | class declaration |
struct | class declaration |
this | current instance |
typeid | get the type/class corresponding to an object/instance/value |
class child : parent | inheritance |
delete | manually call an object's destructor |
object.method(para) | method invocation |
object->method(para) | method invocation |
object.method() | method invocation (with no parameter) |
o2 = o(3) | object cloning |
new class_name(...) | object creation |
class_name v(...) | object creation |
dynamic_cast | testing class membership |
namespace p { ... } | declare |
using namespace p; | import (everything into current namespace) |
using p::name1; using p::name2; ... | import (selectively) |
:: | package scope |
s[n] | accessing n-th character |
at(4) | accessing n-th character |
(char) c | ascii to character |
'z' | character "z" |
(int) c | character to ascii |
char | character type name |
substr | extract a substring |
find | locate a substring |
rfind | locate a substring (starting at the end) |
printf | simple print (printf-like) |
sprintf | sprintf-like |
+ | string concatenation |
== != | string equality & inequality |
length | string size |
size | string size |
"\n" | strings (end-of-line (without writing the real CR or LF character)) |
"..." | strings (with no interpolation of variables) |
char const[] | type name |
string | type name |
toupper / tolower | upper / lower case character |
false | false value |
NULL | false value |
0(5) | false value |
'\0' | false value |
! | logical not |
|| / && | logical or / and (short circuit) |
true | true value |
anything not false | true value |
bool | type name |
push_front | adding an element at the beginning (list cons) (side-effect) |
push_back | adding an element at the end (side-effect) |
find | find an element |
find_if | find an element |
begin | first element (iterator) |
for_each | for each element do something |
{ a, b, c }(6) | list constructor |
size | list size |
a[i] | list/array indexing |
at(7) | list/array indexing |
unique(8) | remove duplicates |
reverse | reverse |
reverse_copy | reverse |
min_element / max_element | smallest / biggest element |
sort(9) | sort |
transform | transform a list (or bag) in another one |
transform | transform two lists in parallel |
vector | type name |
Unknown:
join a list of strings in a string using a glue string
h[k] | dictionary (access: read/write) |
find(10) | dictionary (has the key ?) |
insert(11) | dictionary (merge) |
erase | dictionary (remove by key) |
std::map | dictionary (type name) |
enum typ { n1; n2; ... }(12) | enumerated type declaration |
0(13) | optional value (null value) |
*v(13) | optional value (value) |
. | record (selector) |
-> | record (selector) |
struct { typ1 n1; typ2 n2; ... } | record (type declaration) |
& | reference (pointer) (creation) |
*(14) | reference (pointer) (dereference) |
->(15) | reference (pointer) (dereference) |
union { typ1 n1; typ2 n2; ... } | union type declaration |
Unknown:
optional value (null coalescing)
+ / - / * / / | addition / subtraction / multiplication / division |
& / | / ^ | bitwise operators (and / or / xor) |
~ | bitwise operators (bitwise inversion) |
<< / >> | bitwise operators (left shift / right shift / unsigned right shift) |
pow | exponentiation (power) |
log10 | logarithm (base 10) |
log | logarithm (base e) |
% | modulo (modulo of -3 / 2 is -1) |
- | negation |
1000., 1E3 | numbers syntax (floating point) |
07, 0xf | numbers syntax (integers in base 2, octal and hexadecimal) |
1000 | numbers syntax (integers) |
mathematical | operator priorities and associativities (addition vs multiplication) |
sqrt / exp / abs | square root / e-exponential / absolute value |
sin / cos / tan | trigonometry (basic) |
asin / acos / atan(16) | trigonometry (inverse) |
trunc / round / floor / ceil | truncate / round / floor / ceil |
Unknown:
type name
random (random number)
random (seed the pseudo random generator)