summaryrefslogtreecommitdiff
path: root/boost/functional
diff options
context:
space:
mode:
Diffstat (limited to 'boost/functional')
-rw-r--r--boost/functional/factory.hpp20
-rw-r--r--boost/functional/hash/detail/hash_float.hpp2
-rw-r--r--boost/functional/value_factory.hpp1
3 files changed, 19 insertions, 4 deletions
diff --git a/boost/functional/factory.hpp b/boost/functional/factory.hpp
index 4aa4267..67fee71 100644
--- a/boost/functional/factory.hpp
+++ b/boost/functional/factory.hpp
@@ -15,11 +15,14 @@
# include <new>
# include <boost/pointee.hpp>
-# include <boost/none_t.hpp>
# include <boost/get_pointer.hpp>
# include <boost/non_type.hpp>
# include <boost/type_traits/remove_cv.hpp>
+# if defined(BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T)
+# include <boost/none_t.hpp>
+# endif
+
# ifndef BOOST_FUNCTIONAL_FACTORY_MAX_ARITY
# define BOOST_FUNCTIONAL_FACTORY_MAX_ARITY 10
# elif BOOST_FUNCTIONAL_FACTORY_MAX_ARITY < 3
@@ -35,14 +38,20 @@ namespace boost
factory_passes_alloc_to_smart_pointer
};
+#if defined(BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T)
template< typename Pointer, class Allocator = boost::none_t,
factory_alloc_propagation AP = factory_alloc_for_pointee_and_deleter >
class factory;
+#else
+ template< typename Pointer, class Allocator = void,
+ factory_alloc_propagation AP = factory_alloc_for_pointee_and_deleter >
+ class factory;
+#endif
//----- ---- --- -- - - - -
template< typename Pointer, factory_alloc_propagation AP >
- class factory<Pointer, boost::none_t, AP>
+ class factory<Pointer, void, AP>
{
public:
typedef typename boost::remove_cv<Pointer>::type result_type;
@@ -56,6 +65,13 @@ namespace boost
# include BOOST_PP_ITERATE()
};
+#if defined(BOOST_FUNCTIONAL_FACTORY_SUPPORT_NONE_T)
+ template< typename Pointer, factory_alloc_propagation AP >
+ class factory<Pointer, boost::none_t, AP>
+ : public factory<Pointer, void, AP>
+ {};
+#endif
+
template< class Pointer, class Allocator, factory_alloc_propagation AP >
class factory
: private Allocator::template rebind< typename boost::pointee<
diff --git a/boost/functional/hash/detail/hash_float.hpp b/boost/functional/hash/detail/hash_float.hpp
index ee0ee87..eb9264f 100644
--- a/boost/functional/hash/detail/hash_float.hpp
+++ b/boost/functional/hash/detail/hash_float.hpp
@@ -68,7 +68,7 @@ namespace boost
std::size_t seed = 0;
if (length >= sizeof(std::size_t)) {
- seed = *(std::size_t*) ptr;
+ std::memcpy(&seed, ptr, sizeof(std::size_t));
length -= sizeof(std::size_t);
ptr += sizeof(std::size_t);
diff --git a/boost/functional/value_factory.hpp b/boost/functional/value_factory.hpp
index 6047908..ba94c2a 100644
--- a/boost/functional/value_factory.hpp
+++ b/boost/functional/value_factory.hpp
@@ -15,7 +15,6 @@
# include <new>
# include <boost/pointee.hpp>
-# include <boost/none_t.hpp>
# include <boost/get_pointer.hpp>
# include <boost/non_type.hpp>
# include <boost/type_traits/remove_cv.hpp>