epoc32/include/stdapis/boost/mpl/next_prior.hpp
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
     1.1 --- a/epoc32/include/stdapis/boost/mpl/next_prior.hpp	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/next_prior.hpp	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,51 +1,49 @@
     1.4 -//  Boost next_prior.hpp header file  ---------------------------------------//
     1.5  
     1.6 -//  (C) Copyright Dave Abrahams and Daniel Walker 1999-2003. Distributed under the Boost
     1.7 -//  Software License, Version 1.0. (See accompanying file
     1.8 -//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     1.9 +#ifndef BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
    1.10 +#define BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
    1.11  
    1.12 -//  See http://www.boost.org/libs/utility for documentation.
    1.13 +// Copyright Aleksey Gurtovoy 2000-2004
    1.14 +//
    1.15 +// Distributed under the Boost Software License, Version 1.0. 
    1.16 +// (See accompanying file LICENSE_1_0.txt or copy at 
    1.17 +// http://www.boost.org/LICENSE_1_0.txt)
    1.18 +//
    1.19 +// See http://www.boost.org/libs/mpl for documentation.
    1.20  
    1.21 -//  Revision History
    1.22 -//  13 Dec 2003  Added next(x, n) and prior(x, n) (Daniel Walker)
    1.23 +// $Source: /cvsroot/boost/boost/boost/mpl/next_prior.hpp,v $
    1.24 +// $Date: 2004/09/17 06:09:38 $
    1.25 +// $Revision: 1.3 $
    1.26  
    1.27 -#ifndef BOOST_NEXT_PRIOR_HPP_INCLUDED
    1.28 -#define BOOST_NEXT_PRIOR_HPP_INCLUDED
    1.29 +#include <boost/mpl/aux_/common_name_wknd.hpp>
    1.30 +#include <boost/mpl/aux_/na_spec.hpp>
    1.31 +#include <boost/mpl/aux_/lambda_support.hpp>
    1.32  
    1.33 -#include <iterator>
    1.34 +namespace boost { namespace mpl {
    1.35  
    1.36 -namespace boost {
    1.37 +BOOST_MPL_AUX_COMMON_NAME_WKND(next)
    1.38 +BOOST_MPL_AUX_COMMON_NAME_WKND(prior)
    1.39  
    1.40 -//  Helper functions for classes like bidirectional iterators not supporting
    1.41 -//  operator+ and operator-
    1.42 -//
    1.43 -//  Usage:
    1.44 -//    const std::list<T>::iterator p = get_some_iterator();
    1.45 -//    const std::list<T>::iterator prev = boost::prior(p);
    1.46 -//    const std::list<T>::iterator next = boost::next(prev, 2);
    1.47 +template<
    1.48 +      typename BOOST_MPL_AUX_NA_PARAM(T)
    1.49 +    >
    1.50 +struct next
    1.51 +{
    1.52 +    typedef typename T::next type;
    1.53 +    BOOST_MPL_AUX_LAMBDA_SUPPORT(1,next,(T))
    1.54 +};
    1.55  
    1.56 -//  Contributed by Dave Abrahams
    1.57 +template<
    1.58 +      typename BOOST_MPL_AUX_NA_PARAM(T)
    1.59 +    >
    1.60 +struct prior
    1.61 +{
    1.62 +    typedef typename T::prior type;
    1.63 +    BOOST_MPL_AUX_LAMBDA_SUPPORT(1,prior,(T))
    1.64 +};
    1.65  
    1.66 -template <class T>
    1.67 -inline T next(T x) { return ++x; }
    1.68 +BOOST_MPL_AUX_NA_SPEC(1, next)
    1.69 +BOOST_MPL_AUX_NA_SPEC(1, prior)
    1.70  
    1.71 -template <class T, class Distance>
    1.72 -inline T next(T x, Distance n)
    1.73 -{
    1.74 -    std::advance(x, n);
    1.75 -    return x;
    1.76 -}
    1.77 +}}
    1.78  
    1.79 -template <class T>
    1.80 -inline T prior(T x) { return --x; }
    1.81 -
    1.82 -template <class T, class Distance>
    1.83 -inline T prior(T x, Distance n)
    1.84 -{
    1.85 -    std::advance(x, -n);
    1.86 -    return x;
    1.87 -}
    1.88 -
    1.89 -} // namespace boost
    1.90 -
    1.91 -#endif  // BOOST_NEXT_PRIOR_HPP_INCLUDED
    1.92 +#endif // BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED