epoc32/include/stdapis/boost/mpl/advance.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/advance.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,76 @@
     1.4 +
     1.5 +#ifndef BOOST_MPL_ADVANCE_HPP_INCLUDED
     1.6 +#define BOOST_MPL_ADVANCE_HPP_INCLUDED
     1.7 +
     1.8 +// Copyright Aleksey Gurtovoy 2000-2004
     1.9 +//
    1.10 +// Distributed under the Boost Software License, Version 1.0. 
    1.11 +// (See accompanying file LICENSE_1_0.txt or copy at 
    1.12 +// http://www.boost.org/LICENSE_1_0.txt)
    1.13 +//
    1.14 +// See http://www.boost.org/libs/mpl for documentation.
    1.15 +
    1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/advance.hpp,v $
    1.17 +// $Date: 2004/09/02 15:40:41 $
    1.18 +// $Revision: 1.9 $
    1.19 +
    1.20 +#include <boost/mpl/advance_fwd.hpp>
    1.21 +#include <boost/mpl/less.hpp>
    1.22 +#include <boost/mpl/negate.hpp>
    1.23 +#include <boost/mpl/long.hpp>
    1.24 +#include <boost/mpl/if.hpp>
    1.25 +#include <boost/mpl/tag.hpp>
    1.26 +#include <boost/mpl/apply_wrap.hpp>
    1.27 +#include <boost/mpl/aux_/advance_forward.hpp>
    1.28 +#include <boost/mpl/aux_/advance_backward.hpp>
    1.29 +#include <boost/mpl/aux_/value_wknd.hpp>
    1.30 +#include <boost/mpl/aux_/na_spec.hpp>
    1.31 +#include <boost/mpl/aux_/nttp_decl.hpp>
    1.32 +
    1.33 +namespace boost { namespace mpl {
    1.34 +
    1.35 +// default implementation for forward/bidirectional iterators
    1.36 +template< typename Tag >
    1.37 +struct advance_impl
    1.38 +{
    1.39 +    template< typename Iterator, typename N > struct apply
    1.40 +    {
    1.41 +        typedef typename less< N,long_<0> >::type backward_;
    1.42 +        typedef typename if_< backward_, negate<N>, N >::type offset_;
    1.43 +
    1.44 +        typedef typename if_<
    1.45 +              backward_
    1.46 +            , aux::advance_backward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
    1.47 +            , aux::advance_forward< BOOST_MPL_AUX_VALUE_WKND(offset_)::value >
    1.48 +            >::type f_;
    1.49 +
    1.50 +        typedef typename apply_wrap1<f_,Iterator>::type type;
    1.51 +    };
    1.52 +};
    1.53 +
    1.54 +
    1.55 +template<
    1.56 +      typename BOOST_MPL_AUX_NA_PARAM(Iterator)
    1.57 +    , typename BOOST_MPL_AUX_NA_PARAM(N)
    1.58 +    >
    1.59 +struct advance
    1.60 +    : advance_impl< typename tag<Iterator>::type >
    1.61 +        ::template apply<Iterator,N>
    1.62 +{
    1.63 +};
    1.64 +
    1.65 +template<
    1.66 +      typename Iterator
    1.67 +    , BOOST_MPL_AUX_NTTP_DECL(long, N)
    1.68 +    >
    1.69 +struct advance_c
    1.70 +    : advance_impl< typename tag<Iterator>::type >
    1.71 +        ::template apply<Iterator,long_<N> >
    1.72 +{
    1.73 +};
    1.74 +
    1.75 +BOOST_MPL_AUX_NA_SPEC(2, advance)
    1.76 +
    1.77 +}}
    1.78 +
    1.79 +#endif // BOOST_MPL_ADVANCE_HPP_INCLUDED