, volatile , , , volatile ( / ).
, volatile C ++, . :
void do_thing(const std::vector<int>& v) {
if (v.empty()) {
do_thing_1();
} else {
do_thing_2();
}
}
, volatile if:
void do_thing(const std::vector<int>& v) {
volatile bool condition = v.empty();
if (condition) {
do_thing_1();
} else {
do_thing_2();
}
}
volatile, . if, condition ( v).
condition a static, : , , "" .
, , , .