summaryrefslogtreecommitdiff
path: root/libs/functional
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-04-08 03:09:47 +0000
committer <>2015-05-05 14:37:32 +0000
commitf2541bb90af059680aa7036f315f052175999355 (patch)
treea5b214744b256f07e1dc2bd7273035a7808c659f /libs/functional
parented232fdd34968697a68783b3195b1da4226915b5 (diff)
downloadboost-tarball-master.tar.gz
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/functional')
-rw-r--r--libs/functional/factory/doc/factory.qbk15
-rw-r--r--libs/functional/factory/doc/html/index.html22
-rw-r--r--libs/functional/factory/test/Jamfile4
-rw-r--r--libs/functional/factory/test/factory_with_none_t.cpp36
-rw-r--r--libs/functional/hash/doc/changes.qbk5
5 files changed, 80 insertions, 2 deletions
diff --git a/libs/functional/factory/doc/factory.qbk b/libs/functional/factory/doc/factory.qbk
index 7aa3faff3..3b4e99b30 100644
--- a/libs/functional/factory/doc/factory.qbk
+++ b/libs/functional/factory/doc/factory.qbk
@@ -317,7 +317,7 @@ separately allocated reference counter).
};
template< typename Pointer,
- class Allocator = boost::none_t,
+ class Allocator = void,
factory_alloc_propagation AllocProp =
factory_alloc_for_pointee_and_deleter >
class factory;
@@ -351,6 +351,19 @@ maximum arity. It defaults to 10.
[endsect]
+[section Changes]
+
+[heading Boost 1.58.0]
+
+In order to remove the dependency on Boost.Optional, the default parameter
+for allocators has been changed from `boost::none_t` to `void`.
+If you have code that has stopped working because it uses `boost::none_t`,
+a quick fix is to define `BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T`, which will
+restore support, but this will be removed in a future release.
+It should be be relatively easy to fix this properly.
+
+[endsect]
+
[section Acknowledgements]
Eric Niebler requested a function to invoke a type's constructor (with the
diff --git a/libs/functional/factory/doc/html/index.html b/libs/functional/factory/doc/html/index.html
index 113162916..ae400d661 100644
--- a/libs/functional/factory/doc/html/index.html
+++ b/libs/functional/factory/doc/html/index.html
@@ -38,6 +38,7 @@
<dt><span class="section"><a href="index.html#boost_functional_factory.brief_description">Brief Description</a></span></dt>
<dt><span class="section"><a href="index.html#boost_functional_factory.background">Background</a></span></dt>
<dt><span class="section"><a href="index.html#boost_functional_factory.reference">Reference</a></span></dt>
+<dt><span class="section"><a href="index.html#boost_functional_factory.changes">Changes</a></span></dt>
<dt><span class="section"><a href="index.html#boost_functional_factory.acknowledgements">Acknowledgements</a></span></dt>
<dt><span class="section"><a href="index.html#boost_functional_factory.references">References</a></span></dt>
</dl>
@@ -448,7 +449,7 @@
<span class="special">};</span>
<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pointer</span><span class="special">,</span>
- <span class="keyword">class</span> <span class="identifier">Allocator</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">none_t</span><span class="special">,</span>
+ <span class="keyword">class</span> <span class="identifier">Allocator</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">,</span>
<span class="identifier">factory_alloc_propagation</span> <span class="identifier">AllocProp</span> <span class="special">=</span>
<span class="identifier">factory_alloc_for_pointee_and_deleter</span> <span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">factory</span><span class="special">;</span>
@@ -567,6 +568,25 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_functional_factory.changes"></a><a class="link" href="index.html#boost_functional_factory.changes" title="Changes">Changes</a>
+</h2></div></div></div>
+<h4>
+<a name="boost_functional_factory.changes.h0"></a>
+ <span class="phrase"><a name="boost_functional_factory.changes.boost_1_58_0"></a></span><a class="link" href="index.html#boost_functional_factory.changes.boost_1_58_0">Boost
+ 1.58.0</a>
+ </h4>
+<p>
+ In order to remove the dependency on Boost.Optional, the default parameter
+ for allocators has been changed from <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">none_t</span></code>
+ to <code class="computeroutput"><span class="keyword">void</span></code>. If you have code that
+ has stopped working because it uses <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">none_t</span></code>,
+ a quick fix is to define <code class="computeroutput"><span class="identifier">BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T</span></code>,
+ which will restore support, but this will be removed in a future release. It
+ should be be relatively easy to fix this properly.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_functional_factory.acknowledgements"></a><a class="link" href="index.html#boost_functional_factory.acknowledgements" title="Acknowledgements">Acknowledgements</a>
</h2></div></div></div>
<p>
diff --git a/libs/functional/factory/test/Jamfile b/libs/functional/factory/test/Jamfile
index 6c4f6eb82..fe5041f3e 100644
--- a/libs/functional/factory/test/Jamfile
+++ b/libs/functional/factory/test/Jamfile
@@ -14,5 +14,9 @@ test-suite functional/factory
[ run value_factory.cpp ]
[ run factory.cpp ]
[ run factory_with_allocator.cpp ]
+ [ compile-fail factory_with_none_t.cpp ]
+ [ run factory.cpp : : : <define>BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T : none_t_factory ]
+ [ run factory_with_allocator.cpp : : : <define>BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T : none_t_factory_with_allocator ]
+ [ run factory_with_none_t.cpp : : : <define>BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T : none_t_factory_with_none_t ]
;
diff --git a/libs/functional/factory/test/factory_with_none_t.cpp b/libs/functional/factory/test/factory_with_none_t.cpp
new file mode 100644
index 000000000..cf203f041
--- /dev/null
+++ b/libs/functional/factory/test/factory_with_none_t.cpp
@@ -0,0 +1,36 @@
+/*=============================================================================
+ Copyright (c) 2007 Tobias Schwinger
+
+ Use modification and distribution are subject to 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).
+==============================================================================*/
+
+#include <boost/functional/factory.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <memory>
+
+class sum
+{
+ int val_sum;
+ public:
+ sum(int a, int b) : val_sum(a + b) { }
+
+ operator int() const { return this->val_sum; }
+};
+
+int main()
+{
+ int one = 1, two = 2;
+ {
+ sum* instance( boost::factory< sum*, boost::none_t >()(one,two) );
+ BOOST_TEST(*instance == 3);
+ }
+ {
+ std::auto_ptr<sum> instance(
+ boost::factory< std::auto_ptr<sum>, boost::none_t >()(one,two) );
+ BOOST_TEST(*instance == 3);
+ }
+ return boost::report_errors();
+}
diff --git a/libs/functional/hash/doc/changes.qbk b/libs/functional/hash/doc/changes.qbk
index aadeb9776..f7ab411eb 100644
--- a/libs/functional/hash/doc/changes.qbk
+++ b/libs/functional/hash/doc/changes.qbk
@@ -174,4 +174,9 @@
* Ongoing work on improving `hash_combine`. This changes the combine function
which was previously defined in the reference documentation.
+[h2 Boost 1.58.0]
+
+* Fixed strict aliasing violation
+ ([@https://github.com/boostorg/functional/pull/3 GitHub #3]).
+
[endsect]