spirit/classic/test/impl/var.hpp
Joel de Guzman 994d4e48cc moving stuff to classic spirit
[SVN r44163]
2008-04-10 23:51:31 +00:00

35 lines
985 B
C++

/*=============================================================================
Copyright (c) 2003 Martin Wille
http://spirit.sourceforge.net/
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef BOOST_SPIRIT_TEST_IMPL_VAR_HPP
#define BOOST_SPIRIT_TEST_IMPL_VAR_HPP
#include <boost/ref.hpp>
namespace test
{
template <typename T>
struct var_wrapper
: public ::boost::reference_wrapper<T>
{
typedef ::boost::reference_wrapper<T> parent;
explicit inline var_wrapper(T& t) : parent(t) {}
inline T& operator()() const { return parent::get(); }
};
template <typename T>
inline var_wrapper<T>
var(T& t)
{
return var_wrapper<T>(t);
}
}
#endif // BOOST_SPIRIT_TEST_IMPL_VAR_HPP