Feature #152
Replace bool3 by tribool
Description
In some quiet moment switch to using BOOST's tribool
(or C++11 equivalent if it exists).
It seems pointless trying to maintain a rival implementation.
Of course, this does mean accepting BOOST's approach to automatic conversions, printing of tribool
values, etc.
Related issues
History
#1 Updated by Anna Maria Bigatti almost 10 years ago
- Target version set to CoCoALib-0.99533 Easter14
#2 Updated by John Abbott almost 10 years ago
- Target version changed from CoCoALib-0.99533 Easter14 to CoCoALib-0.99534 Seoul14
#3 Updated by John Abbott over 9 years ago
- Target version changed from CoCoALib-0.99534 Seoul14 to CoCoALib-1.0
#4 Updated by Redmine Admin almost 9 years ago
- Category set to Data Structures
#5 Updated by John Abbott almost 8 years ago
- Related to Design #83: C++11 compatibility questions added
#6 Updated by John Abbott about 3 years ago
- Status changed from New to In Progress
- Assignee set to John Abbott
- Target version changed from CoCoALib-1.0 to CoCoALib-0.99850
- % Done changed from 0 to 10
While the impl in BOOST is surely good, I do prefer to keep CoCoALib independent of BOOST (of course, the interpreter is a different matter).
I have just updated the impl to be cleaner C++11 (with enum class
and constexpr
).
Amazingly (after a few false starts) it all compiles and the tests pass!
I'll think some more before doing anything drastic though...
#7 Updated by John Abbott about 3 years ago
- Status changed from In Progress to Resolved
- Target version changed from CoCoALib-0.99850 to CoCoALib-0.99800
- % Done changed from 10 to 80
I have updated the code. Maybe the revised impl is cleaner.
Anyway, it all seems to work. The code is so simple, that its costs almost nothing to maintain (so I see no real reason to use BOOST).
#8 Updated by John Abbott about 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 80 to 100
- Estimated time set to 2.90 h
I think the new version is OK now. I have also put in noexcept
where appropriate.
One inconsistency: we can assign to a bool3
from a standard bool
, but the ctor is explicit.
Overall, I think this is a fair compromise.