This commit is contained in:
joaquintides 2018-03-13 22:05:01 +01:00
parent 4753b325c5
commit 4d21e89621
3 changed files with 63 additions and 3 deletions

View File

@ -30,6 +30,7 @@ Acknowledgements
<h2>Contents</h2>
<ul>
<li><a href="#boost_1_68">Boost 1.68 release</a></li>
<li><a href="#boost_1_67">Boost 1.67 release</a></li>
<li><a href="#boost_1_66">Boost 1.66 release</a></li>
<li><a href="#boost_1_64">Boost 1.64 release</a></li>
@ -57,6 +58,17 @@ Acknowledgements
<li><a href="#boost_1_33">Boost 1.33 release</a></li>
</ul>
<h2><a name="boost_1_68">Boost 1.68 release</a></h2>
<p>
<ul>
<li>Containers of moveable but non-copyable elements can now be serialized
(ticket <a href="https://svn.boost.org/trac10/ticket/13478">#13478</a>).
Thanks to S&eacute;bastien Paris for the report.
</li>
</ul>
</p>
<h2><a name="boost_1_67">Boost 1.67 release</a></h2>
<p>
@ -572,7 +584,7 @@ Acknowledgements
<br>
<p>Revised January 3rd 2018</p>
<p>Revised March 13th 2018</p>
<p>&copy; Copyright 2003-2018 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software

View File

@ -960,7 +960,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
for(std::size_t n=0;n<s;++n){
detail::archive_constructed<Value> value("item",ar,value_version);
std::pair<node_type*,bool> p=insert_(
std::pair<node_type*,bool> p=insert_rv_(
value.get(),super::end().get_node());
if(!p.second)throw_exception(
archive::archive_exception(

View File

@ -1,6 +1,6 @@
/* Boost.MultiIndex test for serialization, part 3.
*
* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Copyright 2003-2018 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@ -11,6 +11,7 @@
#include "test_serialization3.hpp"
#include "test_serialization_template.hpp"
#include <boost/move/core.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
@ -70,6 +71,36 @@ template<> struct version<non_default_ctble>
} /* namespace serialization */
} /* namespace boost*/
struct non_copyable
{
non_copyable(int n_=0):n(n_){}
non_copyable(BOOST_RV_REF(non_copyable) x):n(x.n){}
bool operator==(const non_copyable& x)const{return n==x.n;}
bool operator<(const non_copyable& x)const{return n<x.n;}
int n;
private:
BOOST_MOVABLE_BUT_NOT_COPYABLE(non_copyable)
};
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
namespace boost{
namespace serialization{
#endif
template<class Archive>
void serialize(Archive& ar,non_copyable& x,const unsigned int)
{
ar&boost::serialization::make_nvp("n",x.n);
}
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
} /* namespace serialization */
} /* namespace boost*/
#endif
using namespace boost::multi_index;
void test_serialization3()
@ -165,4 +196,21 @@ void test_serialization3()
for(int i=0;i<100;++i)m.insert(non_default_ctble(i));
test_serialization(m);
}
{
/* testcase for https://svn.boost.org/trac10/ticket/13478 */
typedef multi_index_container<
non_copyable,
indexed_by<
ordered_unique<
BOOST_MULTI_INDEX_MEMBER(non_copyable,int,n)
>
>
> multi_index_t;
multi_index_t m;
for(int i=0;i<100;++i)m.insert(non_copyable(i));
test_serialization(m);
}
}