diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-06-27 11:11:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-27 11:11:13 (GMT) |
commit | e24393f41834f116038faf6c6d5012575a67136a (patch) | |
tree | a1e83679e55781bc92849a07c5acda7b5c09908c /contrib/src/boost/move/algo/move.hpp | |
parent | b3a2d91805feb81f79ee52c30a077521912b0bf9 (diff) | |
parent | 3a5692f40663282640775f8ff497c4860d265a2a (diff) | |
download | uscxml-e24393f41834f116038faf6c6d5012575a67136a.zip uscxml-e24393f41834f116038faf6c6d5012575a67136a.tar.gz uscxml-e24393f41834f116038faf6c6d5012575a67136a.tar.bz2 |
Merge pull request #149 from tklab-tud/sradomski
remerge
Diffstat (limited to 'contrib/src/boost/move/algo/move.hpp')
-rw-r--r-- | contrib/src/boost/move/algo/move.hpp | 310 |
1 files changed, 155 insertions, 155 deletions
diff --git a/contrib/src/boost/move/algo/move.hpp b/contrib/src/boost/move/algo/move.hpp index ce96bba..943f286 100644 --- a/contrib/src/boost/move/algo/move.hpp +++ b/contrib/src/boost/move/algo/move.hpp @@ -1,155 +1,155 @@ -//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2012-2016.
-// 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)
-//
-// See http://www.boost.org/libs/move for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//! \file
-
-#ifndef BOOST_MOVE_ALGO_MOVE_HPP
-#define BOOST_MOVE_ALGO_MOVE_HPP
-
-#ifndef BOOST_CONFIG_HPP
-# include <boost/config.hpp>
-#endif
-#
-#if defined(BOOST_HAS_PRAGMA_ONCE)
-# pragma once
-#endif
-
-#include <boost/move/detail/config_begin.hpp>
-
-#include <boost/move/utility_core.hpp>
-#include <boost/move/detail/iterator_traits.hpp>
-#include <boost/detail/no_exceptions_support.hpp>
-
-namespace boost {
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// move
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
-
- //! <b>Effects</b>: Moves elements in the range [first,last) into the range [result,result + (last -
- //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first),
- //! performs *(result + n) = ::boost::move (*(first + n)).
- //!
- //! <b>Effects</b>: result + (last - first).
- //!
- //! <b>Requires</b>: result shall not be in the range [first,last).
- //!
- //! <b>Complexity</b>: Exactly last - first move assignments.
- template <typename I, // I models InputIterator
- typename O> // O models OutputIterator
- O move(I f, I l, O result)
- {
- while (f != l) {
- *result = ::boost::move(*f);
- ++f; ++result;
- }
- return result;
- }
-
- //////////////////////////////////////////////////////////////////////////////
- //
- // move_backward
- //
- //////////////////////////////////////////////////////////////////////////////
-
- //! <b>Effects</b>: Moves elements in the range [first,last) into the range
- //! [result - (last-first),result) starting from last - 1 and proceeding to
- //! first. For each positive integer n <= (last - first),
- //! performs *(result - n) = ::boost::move(*(last - n)).
- //!
- //! <b>Requires</b>: result shall not be in the range [first,last).
- //!
- //! <b>Returns</b>: result - (last - first).
- //!
- //! <b>Complexity</b>: Exactly last - first assignments.
- template <typename I, // I models BidirectionalIterator
- typename O> // O models BidirectionalIterator
- O move_backward(I f, I l, O result)
- {
- while (f != l) {
- --l; --result;
- *result = ::boost::move(*l);
- }
- return result;
- }
-
-#else
-
- using ::std::move_backward;
-
-#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// uninitialized_move
-//
-//////////////////////////////////////////////////////////////////////////////
-
-//! <b>Effects</b>:
-//! \code
-//! for (; first != last; ++result, ++first)
-//! new (static_cast<void*>(&*result))
-//! typename iterator_traits<ForwardIterator>::value_type(boost::move(*first));
-//! \endcode
-//!
-//! <b>Returns</b>: result
-template
- <typename I, // I models InputIterator
- typename F> // F models ForwardIterator
-F uninitialized_move(I f, I l, F r
- /// @cond
-// ,typename ::boost::move_detail::enable_if<has_move_emulation_enabled<typename boost::movelib::iterator_traits<I>::value_type> >::type* = 0
- /// @endcond
- )
-{
- typedef typename boost::movelib::iterator_traits<I>::value_type input_value_type;
-
- F back = r;
- BOOST_TRY{
- while (f != l) {
- void * const addr = static_cast<void*>(::boost::move_detail::addressof(*r));
- ::new(addr) input_value_type(::boost::move(*f));
- ++f; ++r;
- }
- }
- BOOST_CATCH(...){
- for (; back != r; ++back){
- back->~input_value_type();
- }
- BOOST_RETHROW;
- }
- BOOST_CATCH_END
- return r;
-}
-
-/// @cond
-/*
-template
- <typename I, // I models InputIterator
- typename F> // F models ForwardIterator
-F uninitialized_move(I f, I l, F r,
- typename ::boost::move_detail::disable_if<has_move_emulation_enabled<typename boost::movelib::iterator_traits<I>::value_type> >::type* = 0)
-{
- return std::uninitialized_copy(f, l, r);
-}
-*/
-
-/// @endcond
-
-} //namespace boost {
-
-#include <boost/move/detail/config_end.hpp>
-
-#endif //#ifndef BOOST_MOVE_ALGO_MOVE_HPP
+////////////////////////////////////////////////////////////////////////////// +// +// (C) Copyright Ion Gaztanaga 2012-2016. +// 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) +// +// See http://www.boost.org/libs/move for documentation. +// +////////////////////////////////////////////////////////////////////////////// + +//! \file + +#ifndef BOOST_MOVE_ALGO_MOVE_HPP +#define BOOST_MOVE_ALGO_MOVE_HPP + +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif +# +#if defined(BOOST_HAS_PRAGMA_ONCE) +# pragma once +#endif + +#include <boost/move/detail/config_begin.hpp> + +#include <boost/move/utility_core.hpp> +#include <boost/move/detail/iterator_traits.hpp> +#include <boost/detail/no_exceptions_support.hpp> + +namespace boost { + +////////////////////////////////////////////////////////////////////////////// +// +// move +// +////////////////////////////////////////////////////////////////////////////// + +#if !defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) + + //! <b>Effects</b>: Moves elements in the range [first,last) into the range [result,result + (last - + //! first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), + //! performs *(result + n) = ::boost::move (*(first + n)). + //! + //! <b>Effects</b>: result + (last - first). + //! + //! <b>Requires</b>: result shall not be in the range [first,last). + //! + //! <b>Complexity</b>: Exactly last - first move assignments. + template <typename I, // I models InputIterator + typename O> // O models OutputIterator + O move(I f, I l, O result) + { + while (f != l) { + *result = ::boost::move(*f); + ++f; ++result; + } + return result; + } + + ////////////////////////////////////////////////////////////////////////////// + // + // move_backward + // + ////////////////////////////////////////////////////////////////////////////// + + //! <b>Effects</b>: Moves elements in the range [first,last) into the range + //! [result - (last-first),result) starting from last - 1 and proceeding to + //! first. For each positive integer n <= (last - first), + //! performs *(result - n) = ::boost::move(*(last - n)). + //! + //! <b>Requires</b>: result shall not be in the range [first,last). + //! + //! <b>Returns</b>: result - (last - first). + //! + //! <b>Complexity</b>: Exactly last - first assignments. + template <typename I, // I models BidirectionalIterator + typename O> // O models BidirectionalIterator + O move_backward(I f, I l, O result) + { + while (f != l) { + --l; --result; + *result = ::boost::move(*l); + } + return result; + } + +#else + + using ::std::move_backward; + +#endif //!defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE) + +////////////////////////////////////////////////////////////////////////////// +// +// uninitialized_move +// +////////////////////////////////////////////////////////////////////////////// + +//! <b>Effects</b>: +//! \code +//! for (; first != last; ++result, ++first) +//! new (static_cast<void*>(&*result)) +//! typename iterator_traits<ForwardIterator>::value_type(boost::move(*first)); +//! \endcode +//! +//! <b>Returns</b>: result +template + <typename I, // I models InputIterator + typename F> // F models ForwardIterator +F uninitialized_move(I f, I l, F r + /// @cond +// ,typename ::boost::move_detail::enable_if<has_move_emulation_enabled<typename boost::movelib::iterator_traits<I>::value_type> >::type* = 0 + /// @endcond + ) +{ + typedef typename boost::movelib::iterator_traits<I>::value_type input_value_type; + + F back = r; + BOOST_TRY{ + while (f != l) { + void * const addr = static_cast<void*>(::boost::move_detail::addressof(*r)); + ::new(addr) input_value_type(::boost::move(*f)); + ++f; ++r; + } + } + BOOST_CATCH(...){ + for (; back != r; ++back){ + back->~input_value_type(); + } + BOOST_RETHROW; + } + BOOST_CATCH_END + return r; +} + +/// @cond +/* +template + <typename I, // I models InputIterator + typename F> // F models ForwardIterator +F uninitialized_move(I f, I l, F r, + typename ::boost::move_detail::disable_if<has_move_emulation_enabled<typename boost::movelib::iterator_traits<I>::value_type> >::type* = 0) +{ + return std::uninitialized_copy(f, l, r); +} +*/ + +/// @endcond + +} //namespace boost { + +#include <boost/move/detail/config_end.hpp> + +#endif //#ifndef BOOST_MOVE_ALGO_MOVE_HPP |