source: NonGTP/Boost/boost/spirit/core/composite/impl/intersection.ipp @ 857

Revision 857, 2.7 KB checked in by igarcia, 18 years ago (diff)
Line 
1/*=============================================================================
2    Copyright (c) 1998-2003 Joel de Guzman
3    Copyright (c) 2001 Daniel Nuffer
4    Copyright (c) 2002 Hartmut Kaiser
5    http://spirit.sourceforge.net/
6
7    Use, modification and distribution is subject to the Boost Software
8    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9    http://www.boost.org/LICENSE_1_0.txt)
10=============================================================================*/
11#if !defined(BOOST_SPIRIT_INTERSECTION_IPP)
12#define BOOST_SPIRIT_INTERSECTION_IPP
13
14namespace boost { namespace spirit {
15
16    ///////////////////////////////////////////////////////////////////////////
17    //
18    //  intersection class implementation
19    //
20    ///////////////////////////////////////////////////////////////////////////
21    template <typename A, typename B>
22    inline intersection<A, B>
23    operator&(parser<A> const& a, parser<B> const& b)
24    {
25        return intersection<A, B>(a.derived(), b.derived());
26    }
27   
28    template <typename A>
29    inline intersection<A, chlit<char> >
30    operator&(parser<A> const& a, char b)
31    {
32        return intersection<A, chlit<char> >(a.derived(), b);
33    }
34   
35    template <typename B>
36    inline intersection<chlit<char>, B>
37    operator&(char a, parser<B> const& b)
38    {
39        return intersection<chlit<char>, B>(a, b.derived());
40    }
41   
42    template <typename A>
43    inline intersection<A, strlit<char const*> >
44    operator&(parser<A> const& a, char const* b)
45    {
46        return intersection<A, strlit<char const*> >(a.derived(), b);
47    }
48   
49    template <typename B>
50    inline intersection<strlit<char const*>, B>
51    operator&(char const* a, parser<B> const& b)
52    {
53        return intersection<strlit<char const*>, B>(a, b.derived());
54    }
55   
56    template <typename A>
57    inline intersection<A, chlit<wchar_t> >
58    operator&(parser<A> const& a, wchar_t b)
59    {
60        return intersection<A, chlit<wchar_t> >(a.derived(), b);
61    }
62   
63    template <typename B>
64    inline intersection<chlit<wchar_t>, B>
65    operator&(wchar_t a, parser<B> const& b)
66    {
67        return intersection<chlit<wchar_t>, B>(a, b.derived());
68    }
69   
70    template <typename A>
71    inline intersection<A, strlit<wchar_t const*> >
72    operator&(parser<A> const& a, wchar_t const* b)
73    {
74        return intersection<A, strlit<wchar_t const*> >(a.derived(), b);
75    }
76   
77    template <typename B>
78    inline intersection<strlit<wchar_t const*>, B>
79    operator&(wchar_t const* a, parser<B> const& b)
80    {
81        return intersection<strlit<wchar_t const*>, B>(a, b.derived());
82    }
83
84}} // namespace boost::spirit
85
86#endif
Note: See TracBrowser for help on using the repository browser.