PageRenderTime 31ms CodeModel.GetById 25ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/Src/Dependencies/Boost/boost/spirit/home/support/detail/what_function.hpp

http://hadesmem.googlecode.com/
C++ Header | 48 lines | 34 code | 7 blank | 7 comment | 0 complexity | 45faf195790c97551a3387c5d0aa6fb0 MD5 | raw file
 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=============================================================================*/
 7#if !defined(SPIRIT_WHAT_FUNCTION_APRIL_22_2007_0236PM)
 8#define SPIRIT_WHAT_FUNCTION_APRIL_22_2007_0236PM
 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
18namespace 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))
33            component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
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
42    private:
43        // silence MSVC warning C4512: assignment operator could not be generated
44        what_function& operator= (what_function const&);
45    };
46}}}
47
48#endif