[Boost-bugs] [Boost C++ Libraries] #3937: equal_pointees and invalid pointers

Subject: [Boost-bugs] [Boost C++ Libraries] #3937: equal_pointees and invalid pointers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-02-16 16:36:59


#3937: equal_pointees and invalid pointers
------------------------------+---------------------------------------------
 Reporter: NN | Owner: no-maintainer
     Type: Feature Requests | Status: new
Milestone: Boost 1.43.0 | Component: utility
  Version: Boost 1.42.0 | Severity: Optimization
 Keywords: |
------------------------------+---------------------------------------------
 In file boost/utility/compare_pointees.hpp function equal_pointees treat
 invalid pointers as a positive value.

 There should be added another function which treats invalid pointers as a
 negative value.

 {{{
 #!cpp

 template<class OptionalPointee>
 inline
 bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
 {
   return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
 }

 template<class OptionalPointee>
 inline
 bool equal_pointees_false ( OptionalPointee const& x, OptionalPointee
 const& y )
 {
   return (!x) != (!y) ? false : ( !x ? false : (*x) == (*y) ) ;
 }
 }}}

 Thanx.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3937>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC