Add copy constructors and assignment operator to unordered_*

This commit is contained in:
Petr Machata 2011-02-05 10:51:31 +01:00
parent 121dc65949
commit d43949dd22
2 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,92 @@
Index: /trunk/boost/unordered/unordered_set.hpp
===================================================================
--- /trunk/boost/unordered/unordered_set.hpp (revision 60754)
+++ /trunk/boost/unordered/unordered_set.hpp (revision 68445)
@@ -155,4 +155,9 @@
#if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_set(unordered_set const& other)
+ : table_(other.table_)
+ {
+ }
+
unordered_set(unordered_set&& other)
: table_(other.table_, boost::unordered_detail::move_tag())
@@ -163,4 +168,10 @@
: table_(other.table_, a, boost::unordered_detail::move_tag())
{
+ }
+
+ unordered_set& operator=(unordered_set const& x)
+ {
+ table_ = x.table_;
+ return *this;
}
@@ -652,4 +663,9 @@
#if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_multiset(unordered_multiset const& other)
+ : table_(other.table_)
+ {
+ }
+
unordered_multiset(unordered_multiset&& other)
: table_(other.table_, boost::unordered_detail::move_tag())
@@ -660,4 +676,10 @@
: table_(other.table_, a, boost::unordered_detail::move_tag())
{
+ }
+
+ unordered_multiset& operator=(unordered_multiset const& x)
+ {
+ table_ = x.table_;
+ return *this;
}
Index: /trunk/boost/unordered/unordered_map.hpp
===================================================================
--- /trunk/boost/unordered/unordered_map.hpp (revision 60754)
+++ /trunk/boost/unordered/unordered_map.hpp (revision 68445)
@@ -161,4 +161,9 @@
#if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_map(unordered_map const& other)
+ : table_(other.table_)
+ {
+ }
+
unordered_map(unordered_map&& other)
: table_(other.table_, boost::unordered_detail::move_tag())
@@ -169,4 +174,10 @@
: table_(other.table_, a, boost::unordered_detail::move_tag())
{
+ }
+
+ unordered_map& operator=(unordered_map const& x)
+ {
+ table_ = x.table_;
+ return *this;
}
@@ -706,4 +717,9 @@
#if !defined(BOOST_NO_RVALUE_REFERENCES)
+ unordered_multimap(unordered_multimap const& other)
+ : table_(other.table_)
+ {
+ }
+
unordered_multimap(unordered_multimap&& other)
: table_(other.table_, boost::unordered_detail::move_tag())
@@ -714,4 +730,10 @@
: table_(other.table_, a, boost::unordered_detail::move_tag())
{
+ }
+
+ unordered_multimap& operator=(unordered_multimap const& x)
+ {
+ table_ = x.table_;
+ return *this;
}

View File

@ -88,6 +88,9 @@ Patch2: boost-cmake-soname.patch
# https://svn.boost.org/trac/boost/ticket/4999
Patch3: boost-1.46.0-signals-erase.patch
# https://svn.boost.org/trac/boost/ticket/5119
Patch4: boost-1.46.0-unordered-cctor.patch
%bcond_with tests
%bcond_with docs_generated
@ -414,6 +417,7 @@ sed 's/_FEDORA_SONAME/%{sonamever}/' %{PATCH2} | %{__patch} -p0 --fuzz=0
# fixes
%patch3 -p1
%patch4 -p2
%build
@ -830,6 +834,10 @@ find $RPM_BUILD_ROOT%{_includedir}/ \( -name '*.pl' -o -name '*.sh' \) -exec %{_
* Thu Feb 3 2011 Petr Machata <pmachata@redhat.com> - 1.46.0-0.1.beta1
- Package 1.46.0-beta1
- Reintroduce the soname patch
- unordered-cctor.patch: Add copy constructors and assignment
operators when using rvalue references
- signals-erase.patch: Pass const_iterator to map::erase to avoid
ambigous overload vs. templatized value_type ctor
- Related: #656410
* Mon Jan 10 2011 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 1.44.0-7