Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/spirit/test/impl/var.hpp @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 985 bytes
Line 
1/*=============================================================================
2    Copyright (c) 2003 Martin Wille
3    http://spirit.sourceforge.net/
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#ifndef BOOST_SPIRIT_TEST_IMPL_VAR_HPP
10#define BOOST_SPIRIT_TEST_IMPL_VAR_HPP
11
12#include <boost/ref.hpp>
13
14namespace test
15{
16    template <typename T>
17    struct var_wrapper
18        : public ::boost::reference_wrapper<T>
19    {
20        typedef ::boost::reference_wrapper<T> parent;
21
22        explicit inline var_wrapper(T& t) : parent(t) {}
23
24        inline T& operator()() const { return parent::get(); }
25    };
26
27    template <typename T>
28    inline var_wrapper<T>
29    var(T& t)
30    {
31        return var_wrapper<T>(t);
32    }
33}
34#endif // BOOST_SPIRIT_TEST_IMPL_VAR_HPP
Note: See TracBrowser for help on using the repository browser.