]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 1999-2003 Jaakko Jarvi | |
3 | Copyright (c) 2001-2011 Joel de Guzman | |
4 | ||
5 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
7 | ==============================================================================*/ | |
8 | #if !defined(FUSION_EQUAL_TO_05052005_0431) | |
9 | #define FUSION_EQUAL_TO_05052005_0431 | |
10 | ||
11 | #include <boost/fusion/support/config.hpp> | |
12 | #include <boost/fusion/sequence/intrinsic/begin.hpp> | |
13 | #include <boost/fusion/sequence/intrinsic/end.hpp> | |
14 | #include <boost/fusion/sequence/intrinsic/size.hpp> | |
15 | #include <boost/fusion/sequence/comparison/detail/equal_to.hpp> | |
16 | #include <boost/fusion/sequence/comparison/enable_comparison.hpp> | |
17 | #include <boost/config.hpp> | |
18 | ||
19 | #if defined (BOOST_MSVC) | |
20 | # pragma warning(push) | |
21 | # pragma warning (disable: 4100) // unreferenced formal parameter | |
22 | #endif | |
23 | ||
24 | namespace boost { namespace fusion | |
25 | { | |
26 | template <typename Seq1, typename Seq2> | |
27 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
28 | inline bool | |
29 | equal_to(Seq1 const& a, Seq2 const& b) | |
30 | { | |
31 | return result_of::size<Seq1>::value == result_of::size<Seq2>::value | |
32 | && detail::sequence_equal_to< | |
33 | Seq1 const, Seq2 const | |
34 | , result_of::size<Seq1>::value == result_of::size<Seq2>::value>:: | |
35 | call(fusion::begin(a), fusion::begin(b)); | |
36 | } | |
37 | ||
38 | namespace operators | |
39 | { | |
40 | template <typename Seq1, typename Seq2> | |
41 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
42 | inline typename | |
43 | boost::enable_if< | |
44 | traits::enable_equality<Seq1, Seq2> | |
45 | , bool | |
46 | >::type | |
47 | operator==(Seq1 const& a, Seq2 const& b) | |
48 | { | |
49 | return fusion::equal_to(a, b); | |
50 | } | |
51 | } | |
52 | using operators::operator==; | |
53 | }} | |
54 | ||
55 | #if defined (BOOST_MSVC) | |
56 | # pragma warning(pop) | |
57 | #endif | |
58 | ||
59 | #endif |