- Move certainly() to Uncertain.h

- Add possibly().
This commit is contained in:
Sylvain Pion 2007-03-01 18:29:19 +00:00
parent edd0306a77
commit 47f0b5f4d2
2 changed files with 22 additions and 10 deletions

View File

@ -327,6 +327,28 @@ Uncertain<T> enum_cast(const Uncertain<U>& u)
#endif
// Additional goodies
inline bool certainly(bool b) { return b; }
inline bool possibly(bool b) { return b; }
inline
bool certainly(Uncertain<bool> const& c)
{
if (is_indeterminate(c))
return false;
else return static_cast<bool>(c);
}
inline
bool possibly(Uncertain<bool> const& c)
{
if (is_indeterminate(c))
return true;
else return static_cast<bool>(c);
}
CGAL_END_NAMESPACE
#endif // CGAL_UNCERTAIN_H

View File

@ -25,16 +25,6 @@
CGAL_BEGIN_NAMESPACE
inline bool certainly( bool c ) { return c ; }
inline
bool certainly( Uncertain<bool> const& c )
{
if ( CGAL_NTS is_indeterminate(c) )
return false ;
else return static_cast<bool>(c) ;
}
inline Uncertain<bool> logical_or ( Uncertain<bool> a, Uncertain<bool> b ) { return a | b ; }
inline Uncertain<bool> logical_and( Uncertain<bool> a, Uncertain<bool> b ) { return a & b ; }