Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82679 - sandbox/varray/boost/container/detail
From: adam.wulkiewicz_at_[hidden]
Date: 2013-02-06 20:23:57


Author: awulkiew
Date: 2013-02-01 09:44:37 EST (Fri, 01 Feb 2013)
New Revision: 82679
URL: http://svn.boost.org/trac/boost/changeset/82679

Log:
elements with trivial ctor don't constructed also when compiler supports variadic templates.
Text files modified:
   sandbox/varray/boost/container/detail/varray_util.hpp | 54 ++++++++++++++++++++--------------------
   1 files changed, 27 insertions(+), 27 deletions(-)

Modified: sandbox/varray/boost/container/detail/varray_util.hpp
==============================================================================
--- sandbox/varray/boost/container/detail/varray_util.hpp (original)
+++ sandbox/varray/boost/container/detail/varray_util.hpp 2013-02-01 09:44:37 EST (Fri, 01 Feb 2013)
@@ -497,6 +497,33 @@
     uninitialized_fill_dispatch(first, last, has_trivial_constructor<value_type>()); // may throw
 }
 
+// construct(I)
+
+template <typename I>
+inline
+void construct_dispatch(I pos,
+ ::boost::mpl::bool_<true> const& /*empty_constr*/)
+{}
+
+template <typename I>
+inline
+void construct_dispatch(I pos,
+ ::boost::mpl::bool_<false> const& /*empty_constr*/)
+{
+ typedef typename ::boost::iterator_value<I>::type V;
+ new (static_cast<void*>(::boost::addressof(*pos))) V(); // may throw
+}
+
+template <typename I>
+inline
+void construct(I pos)
+{
+ typedef typename ::boost::iterator_value<I>::type V;
+ typedef typename ::boost::has_trivial_constructor<V>::type empty_constr;
+
+ construct_dispatch(pos, empty_constr()); // may throw
+}
+
 // construct(I, V)
 
 template <typename I, typename V>
@@ -562,33 +589,6 @@
 
 #else // !BOOST_NO_VARIADIC_TEMPLATES
 
-// construct(I)
-
-template <typename I>
-inline
-void construct_dispatch(I pos,
- ::boost::mpl::bool_<true> const& /*empty_constr*/)
-{}
-
-template <typename I>
-inline
-void construct_dispatch(I pos,
- ::boost::mpl::bool_<false> const& /*empty_constr*/)
-{
- typedef typename ::boost::iterator_value<I>::type V;
- new (static_cast<void*>(::boost::addressof(*pos))) V(); // may throw
-}
-
-template <typename I>
-inline
-void construct(I pos)
-{
- typedef typename ::boost::iterator_value<I>::type V;
- typedef typename ::boost::has_trivial_constructor<V>::type empty_constr;
-
- construct_dispatch(pos, empty_constr()); // may throw
-}
-
 // BOOST_NO_RVALUE_REFERENCES -> P0 const& p0
 // !BOOST_NO_RVALUE_REFERENCES -> P0 && p0
 // which means that version with one parameter may take V const& v


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk