title | description | published | date | tags | editor | dateCreated |
---|---|---|---|---|---|---|
C++ |
true |
2023-01-31 16:06:21 UTC |
markdown |
2023-01-31 16:03:37 UTC |
This page is about C++.
-
inline
in c++- used with static in c++
- defined in header files
- default if the function is defined inner Class
- inline function can be defined several times
- if interface separation is adapted, both declaration and definition need the keyword
-
always use expression without side effect in
assert
macro -
construct member variable in order they defined(
-Wreorder
) -
mutable
andvolatile
mutable
is related to const, a member of a class- mutable field can be changed even in an object accessed through a
const
pointer or reference, or in aconst
object - the compiler KNOWS when a mutable object changes.
volatile
is related to register- compiler prevent
volatile
variable from being put into register volatile
location is one that can be changed by code the compiler DOESN'T know(e.g. some kernel-level driver)
-
CV(const-volatility) specifiers(http://en.cppreference.com/w/cpp/language/cv)
- const
- volatile
- mutable