1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/detail/algorithm.hpp Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,103 @@
1.4 +#ifndef BOOST_ALGORITHM_RG071801_HPP
1.5 +#define BOOST_ALGORITHM_RG071801_HPP
1.6 +
1.7 +//
1.8 +//
1.9 +// Copyright (c) 1994
1.10 +// Hewlett-Packard Company
1.11 +//
1.12 +// Permission to use, copy, modify, distribute and sell this software
1.13 +// and its documentation for any purpose is hereby granted without fee,
1.14 +// provided that the above copyright notice appear in all copies and
1.15 +// that both that copyright notice and this permission notice appear
1.16 +// in supporting documentation. Hewlett-Packard Company makes no
1.17 +// representations about the suitability of this software for any
1.18 +// purpose. It is provided "as is" without express or implied warranty.
1.19 +//
1.20 +//
1.21 +// Copyright (c) 1996-1998
1.22 +// Silicon Graphics Computer Systems, Inc.
1.23 +//
1.24 +// Permission to use, copy, modify, distribute and sell this software
1.25 +// and its documentation for any purpose is hereby granted without fee,
1.26 +// provided that the above copyright notice appear in all copies and
1.27 +// that both that copyright notice and this permission notice appear
1.28 +// in supporting documentation. Silicon Graphics makes no
1.29 +// representations about the suitability of this software for any
1.30 +// purpose. It is provided "as is" without express or implied warranty.
1.31 +//
1.32 +
1.33 +// Copyright 2002 The Trustees of Indiana University.
1.34 +
1.35 +// Use, modification and distribution is subject to the Boost Software
1.36 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.37 +// http://www.boost.org/LICENSE_1_0.txt)
1.38 +
1.39 +// Boost.MultiArray Library
1.40 +// Authors: Ronald Garcia
1.41 +// Jeremy Siek
1.42 +// Andrew Lumsdaine
1.43 +// See http://www.boost.org/libs/multi_array for documentation.
1.44 +
1.45 +
1.46 +#include "boost/iterator.hpp"
1.47 +
1.48 +namespace boost {
1.49 +namespace detail {
1.50 +namespace multi_array {
1.51 +//--------------------------------------------------
1.52 +// copy_n (not part of the C++ standard)
1.53 +#if 1
1.54 +
1.55 +template <class InputIter, class Size, class OutputIter>
1.56 +OutputIter copy_n(InputIter first, Size count,
1.57 + OutputIter result) {
1.58 + for ( ; count > 0; --count) {
1.59 + *result = *first;
1.60 + ++first;
1.61 + ++result;
1.62 + }
1.63 + return result;
1.64 +}
1.65 +#else // !1
1.66 +
1.67 +template <class InputIter, class Size, class OutputIter>
1.68 +OutputIter copy_n__(InputIter first, Size count,
1.69 + OutputIter result,
1.70 + std::input_iterator_tag) {
1.71 + for ( ; count > 0; --count) {
1.72 + *result = *first;
1.73 + ++first;
1.74 + ++result;
1.75 + }
1.76 + return result;
1.77 +}
1.78 +
1.79 +template <class RAIter, class Size, class OutputIter>
1.80 +inline OutputIter
1.81 +copy_n__(RAIter first, Size count,
1.82 + OutputIter result,
1.83 + std::random_access_iterator_tag) {
1.84 + RAIter last = first + count;
1.85 + return std::copy(first, last, result);
1.86 +}
1.87 +
1.88 +template <class InputIter, class Size, class OutputIter>
1.89 +inline OutputIter
1.90 +copy_n__(InputIter first, Size count, OutputIter result) {
1.91 + typedef typename std::iterator_traits<InputIter>::iterator_category cat;
1.92 + return copy_n__(first, count, result, cat());
1.93 +}
1.94 +
1.95 +template <class InputIter, class Size, class OutputIter>
1.96 +inline OutputIter
1.97 +copy_n(InputIter first, Size count, OutputIter result) {
1.98 + return copy_n__(first, count, result);
1.99 +}
1.100 +
1.101 +#endif // 1
1.102 +} // namespace multi_array
1.103 +} // namespace detail
1.104 +} // namespace boost
1.105 +
1.106 +#endif // BOOST_ALGORITHM_RG071801_HPP