mirror of https://github.com/CGAL/cgal
parent
edd0306a77
commit
47f0b5f4d2
|
|
@ -327,6 +327,28 @@ Uncertain<T> enum_cast(const Uncertain<U>& u)
|
||||||
|
|
||||||
#endif
|
#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
|
CGAL_END_NAMESPACE
|
||||||
|
|
||||||
#endif // CGAL_UNCERTAIN_H
|
#endif // CGAL_UNCERTAIN_H
|
||||||
|
|
|
||||||
|
|
@ -25,16 +25,6 @@
|
||||||
|
|
||||||
CGAL_BEGIN_NAMESPACE
|
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_or ( Uncertain<bool> a, Uncertain<bool> b ) { return a | b ; }
|
||||||
inline Uncertain<bool> logical_and( Uncertain<bool> a, Uncertain<bool> b ) { return a & b ; }
|
inline Uncertain<bool> logical_and( Uncertain<bool> a, Uncertain<bool> b ) { return a & b ; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue