Bug 48430 - std::hash partial specialization for std::unique_ptr and std::shared_ptr are using unary_function
Summary: std::hash partial specialization for std::unique_ptr and std::shared_ptr are ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Paolo Carlini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-04 00:41 UTC by Kohei Takahashi
Modified: 2011-07-18 16:08 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-07-18 16:01:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kohei Takahashi 2011-04-04 00:41:39 UTC
std::hash partial specialization for std::unique_ptr (in bits/unique_ptr.h) and std::shared_ptr (in bits/shared_ptr.h) using std::unary_function.
However, you should not use it because std::unary_function is deprecated.
Comment 1 Jonathan Wakely 2011-04-04 07:40:26 UTC
I don't consider this a bug. Even if they were removed from the standard, we could choose to keep them and use them as implementation details, or non-standard extensions.
Users shouldn't rely on deprecated features, because they can go away, but we control the implementation, so we know we can use them safely.
Why is it a problem?
Comment 2 Paolo Carlini 2011-07-18 16:01:24 UTC
Jon is of course right, in terms of conformance. But I think we can start using __hash_base there too, just for consistency. Will do momentarily.
Comment 3 paolo@gcc.gnu.org 2011-07-18 16:07:34 UTC
Author: paolo
Date: Mon Jul 18 16:07:24 2011
New Revision: 176405

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176405
Log:
2011-07-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/48430
	* include/bits/shared_ptr.h (struct hash<shared_ptr<>>): Use
	__hash_base.
	* include/bits/unique_ptr.h (struct hash<unique_ptr<>>): Likewise.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/shared_ptr.h
    trunk/libstdc++-v3/include/bits/unique_ptr.h
Comment 4 Paolo Carlini 2011-07-18 16:08:38 UTC
Done.