source: NonGTP/Boost/boost/spirit/fusion/iterator/detail/iterator_base.hpp @ 857

Revision 857, 1.1 KB checked in by igarcia, 18 years ago (diff)
Line 
1/*=============================================================================
2    Copyright (c) 2003 Joel de Guzman
3    Copyright (c) 2004 Peder Holt
4
5    Use, modification and distribution is subject to the Boost Software
6    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7    http://www.boost.org/LICENSE_1_0.txt)
8==============================================================================*/
9#if !defined(FUSION_ITERATOR_DETAIL_ITERATOR_BASE_HPP)
10#define FUSION_ITERATOR_DETAIL_ITERATOR_BASE_HPP
11
12namespace boost { namespace fusion
13{
14    struct iterator_root {};
15
16    template <typename Iterator>
17    struct iterator_base : iterator_root
18    {
19        Iterator const&
20        cast() const;
21
22        Iterator&
23        cast();
24    };
25
26    template <typename Iterator>
27    Iterator const&
28    iterator_base<Iterator>::cast() const
29    {
30        return static_cast<Iterator const&>(*this);
31    }
32
33    template <typename Iterator>
34    Iterator&
35    iterator_base<Iterator>::cast()
36    {
37        return static_cast<Iterator&>(*this);
38    }
39}}
40
41#endif
Note: See TracBrowser for help on using the repository browser.