fix doc example typo
[boost.git] / boost / fusion / iterator / prior.hpp
blob9a26103967dbcab002ec2eb69a0154bd3b6c9885
1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_PRIOR_05042005_1144)
8 #define FUSION_PRIOR_05042005_1144
10 #include <boost/fusion/support/tag_of.hpp>
12 namespace boost { namespace fusion
14 // Special tags:
15 struct iterator_facade_tag; // iterator facade tag
16 struct array_iterator_tag; // boost::array iterator tag
17 struct mpl_iterator_tag; // mpl sequence iterator tag
18 struct std_pair_iterator_tag; // std::pair iterator tag
20 namespace extension
22 template <typename Tag>
23 struct prior_impl
25 template <typename Iterator>
26 struct apply {};
29 template <>
30 struct prior_impl<iterator_facade_tag>
32 template <typename Iterator>
33 struct apply : Iterator::template prior<Iterator> {};
36 template <>
37 struct prior_impl<array_iterator_tag>;
39 template <>
40 struct prior_impl<mpl_iterator_tag>;
42 template <>
43 struct prior_impl<std_pair_iterator_tag>;
46 namespace result_of
48 template <typename Iterator>
49 struct prior
50 : extension::prior_impl<typename detail::tag_of<Iterator>::type>::
51 template apply<Iterator>
52 {};
55 template <typename Iterator>
56 typename result_of::prior<Iterator>::type const
57 prior(Iterator const& i)
59 return result_of::prior<Iterator>::call(i);
63 #endif