Project

General

Profile

Feature #152

Replace bool3 by tribool

Added by John Abbott almost 12 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Data Structures
Target version:
Start date:
04 May 2012
Due date:
% Done:

100%

Estimated time:
2.90 h
Spent time:

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

Related to CoCoALib - Feature #138: Automatic conversion from bool3 to bool?Closed2012-04-24

Related to CoCoALib - Feature #153: Shorter simpler names for some bool3 values and functionsClosed2012-05-04

Related to CoCoA-5 - Design #83: C++11 compatibility questionsIn Progress2012-01-26

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.

Also available in: Atom PDF