Re: [Boost-bugs] [Boost C++ Libraries] #1444: scoped_ptr::operator== should be equivalent to a.get()==b.get(), but is currently !!a==!!b

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1444: scoped_ptr::operator== should be equivalent to a.get()==b.get(), but is currently !!a==!!b
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-26 12:14:19


#1444: scoped_ptr::operator== should be equivalent to a.get()==b.get(), but is
currently !!a==!!b
-----------------------------------------------+----------------------------
  Reporter: Geoffrey Irving <irving@…> | Owner: pdimov
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: smart_ptr
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------------------+----------------------------
Changes (by p.brockamp@…):

 * cc: p.brockamp@… (added)
  * status: closed => reopened
  * version: Boost 1.34.1 => Boost 1.47.0
  * resolution: fixed =>

Comment:

 Replying to [comment:4 pdimov]:
> I considered adding the obvious operators as suggested, but I can't come
 up with any sensible use case for them, as two scoped pointers are only
 equal when they both store NULL. So I'll just disable the comparisons at
 compile time instead.

 Well, there may be a (minor) use:
 Just disabling them the way you did breaks the explicit instantiation
 request of scoped_ptr's methods. Try to compile this single line:

 template class boost::scoped_ptr<char>;

 This triggers compilation of all methods of template scoped_ptr for the
 specialisation of type "char" (see Stroustrup, C.13.10) - and of course
 fails to compile (which it shouldn't), due to the declared but undefined
 operators == and !=.

 Above code is standard conformant and might be useful when manually
 controlling which specialisations of a template to generate or when
 fiddling around to get Boost up'n'running at all.

 I'm doing the latter here, I have to use a very(!) old version of vxworks
 and I'm trying to use at least parts of Boost, namely smart_ptr. As this
 os-version comes with a desastrously old, buggy and outdated stdlib, STL,
 compiler, etc. this is a real hassle and starts with redefining
 __GNUC_MINOR__ in gcc.hpp (GCC reports V2.9 but in fact is 2.9.6...) :-O
 So I would like to make sure things do at least compile before doing any
 other (presumably futile) tests.

 Maybe one could think of a use for the missing operators in generic
 programming as well, dunno. So it might be worthwhile implementing them in
 spite of their limited usefullness.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/1444#comment:8>
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:07 UTC