This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/42925] Not possible to compare unique_ptr with 0
- From: "jwakely dot gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Feb 2010 17:36:31 -0000
- Subject: [Bug libstdc++/42925] Not possible to compare unique_ptr with 0
- References: <bug-42925-7796@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from jwakely dot gcc at gmail dot com 2010-02-01 17:36 -------
(In reply to comment #5)
> Jon, is there a thread on the reflector about related issues? I spotted
> something but couldn't exactly remember...
LWG 834 is about comparing unique_ptr<T,D>::pointer to nullptr_t
LWG 1307 is about missing != comparisons for other types.
Neither is related to this issue, and I don't know of any thread on this topic.
The code would work if there was:
template<class T1, class D1>
bool operator!=(const unique_ptr<T1, D1>& x, const nullptr_t&);
(along with a version with the arguments reversed, and similarly for
operator==)
But there is no such function in the WP. Nor is there a member
unique_ptr::operator!=(nullptr_t)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42925