]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | ||
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 | =============================================================================*/ | |
f67539c2 TL |
7 | #ifndef BOOST_SPIRIT_SUPPORT_DETAIL_WHAT_FUNCTION_HPP |
8 | #define BOOST_SPIRIT_SUPPORT_DETAIL_WHAT_FUNCTION_HPP | |
7c673cae FG |
9 | |
10 | #if defined(_MSC_VER) | |
11 | #pragma once | |
12 | #endif | |
13 | ||
14 | #include <string> | |
15 | #include <boost/spirit/home/support/info.hpp> | |
16 | #include <boost/detail/workaround.hpp> | |
17 | ||
18 | namespace boost { namespace spirit { namespace detail | |
19 | { | |
20 | template <typename Context> | |
21 | struct what_function | |
22 | { | |
23 | what_function(info& what_, Context& context_) | |
24 | : what(what_), context(context_) | |
25 | { | |
26 | what.value = std::list<info>(); | |
27 | } | |
28 | ||
29 | template <typename Component> | |
30 | void operator()(Component const& component) const | |
31 | { | |
32 | #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600)) | |
1e59de90 | 33 | (void)component; // suppresses warning: C4100: 'component' : unreferenced formal parameter |
7c673cae FG |
34 | #endif |
35 | boost::get<std::list<info> >(what.value). | |
36 | push_back(component.what(context)); | |
37 | } | |
38 | ||
39 | info& what; | |
40 | Context& context; | |
41 | ||
7c673cae | 42 | // silence MSVC warning C4512: assignment operator could not be generated |
92f5a8d4 | 43 | BOOST_DELETED_FUNCTION(what_function& operator= (what_function const&)) |
7c673cae FG |
44 | }; |
45 | }}} | |
46 | ||
47 | #endif |