Proposal for addition: tristate class - 3-state logical type
Jarosław Staniek
js at iidea.pl
Fri Sep 9 22:54:43 BST 2005
File atttached: tristate.h
Proposal for using this at kdelibs level.
Simple yet readable bool type replacement when you need to return a special
"don't know" or "cancelled" state from your function and you detest exceptions
like me. I've estarted to use tristate class in apps, including Kexi, in 2004
with relative success: I was able to avoid using error-prone int type whenever
people just want to return 0, 1 or 2 (2=="don't know").
Contains all necessary casts from bool, operators and special 'cancelled' value.
RFC
--
regards / pozdrawiam,
Jaroslaw Staniek / OpenOffice Polska / Kexi Team
http://www.openoffice.com.pl | http://www.kexi-project.org
KDElibs/Windows: http://wiki.kde.org/tiki-index.php?page=KDElibs+for+win32
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tristate.h
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050909/dc955311/attachment.h>
More information about the kde-core-devel
mailing list