22 lipca
19:52 2005
The tribool class acts like the built-in bool type, but for 3-state boolean logic. The three states are true, false, and indeterminate, where the first two states are equivalent to those of the C++ bool type and the last state represents an unknown boolean value (that may be true or false, we don't know).
Przykłady ;-)tribool is_computer_on_fire(indeterminate); tribool is_computer_on(true); tribool is_user_sane(indeterminate);
Kategoria Ogólne
Proszę o komentarz
no dobrze, ale po co komuś taka zmienna się z ciekawości zapytam...
W SQL się przydaje :]
Nic innego nie przychodzi mi do głowy :)
tribool _cośtam(indeterminate); // niezainicjowane
function bool isCośtam() {
if (_cośtam == indeterminate) {
_cośtam = obliczCośtam();
}
return _cośtam;
}