|
Boost Users : |
Subject: Re: [Boost-users] boost::tribool "if ( someTriboolVar == indeterminate )" semantics is confusing
From: Norbert Wenzel (norbert.wenzel.lists_at_[hidden])
Date: 2014-03-06 10:18:41
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 03/06/2014 03:16 PM, æ£ÄÏÒ ôÒÕÛËÉÎ wrote:
> P.S. I sometimes use boost::optional<bool> to get a kind of
> tri-state value. That works without such surprises.
And fwiw it might use less memory. The simple optional<bool> stores an
additional bool to your value, whereas tribool stores an enum that
might be bigger than sizeof(bool)*2. At least that's what #7659 [0] says.
Norbert
[0] https://svn.boost.org/trac/boost/ticket/7659
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJTGJHRAAoJEN1BMR2v0jNaKYwP/2SCNks2gpIpSznx0DSVYFav
DC+LpV5lN5/uB6iI+UEwQC1Am51dJbGHHtuTtOgPWuZbJc+4mXeZcTD+8+T8yulY
dvDAPMS42Xbut+XmKoU0yV3nrOhVcsEEHpQxBaLaiBP5KQgN27dnqPv71FwlIpt8
Zbuakiy+oaoKzZ4maObXxo7Hlw4JySZvC/H6vXtDDeRDoS0DFm+SfnbLixCmiKCv
9iH318cMgyF92i5ihuBTj7USPud8c2kedRXKaPhzDy+LH2gSwMEzQgOnAEJZzVD7
hLmyC0PS3jKCsTS6cCXBcpwtENZIB0jp1GSlg/3KZvlB0AeEs6g8doytifsDHWRJ
+ABLwPGkLg1+b3O5Bh+OxQgrlwIeBu6S4jb7ZgJ2G/kbXd8Oo5kum7/oeZsSFqRn
bFienJV85Th99hp/55bPbw5mnRKnMSqyfGEZiH4cd/IJtWuCA+DGW3c9hslz+bTJ
RA6uKRHRCDje44M7PTZv7QPn0mIH9J4n8ti+zgs0yv2LcebE9Kuf9WmZrUZPFW5R
U0jf85qSs15n2uIzhgQjW8MtzUCs+SyWoRBLBw1YZXHLqladgavhSDlL0sjKdo5w
o9hfQlcdWMziu5kgr6Xq6m9L1ecqHpWqN63YbeKv1fpwyghUd1vsREAPEEASMui5
Ibsiz5SYm8wlCGU0bkiY
=3CY2
-----END PGP SIGNATURE-----
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net