2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
|
|
|
Copyright (c) 2011-2013 Bolero MURAKAMI
|
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under 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)
|
|
|
|
=============================================================================*/
|
2011-11-13 08:54:38 +00:00
|
|
|
#ifndef SPROUT_WEED_PARSER_LIT_HPP
|
|
|
|
#define SPROUT_WEED_PARSER_LIT_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
2013-03-24 08:07:20 +00:00
|
|
|
#include <sprout/type_traits/remove_shallow_cvref.hpp>
|
2011-11-13 08:54:38 +00:00
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace weed {
|
|
|
|
//
|
|
|
|
// lit_g
|
|
|
|
//
|
|
|
|
struct lit_g {
|
|
|
|
public:
|
|
|
|
template<typename T, typename = void>
|
|
|
|
struct eval;
|
|
|
|
public:
|
|
|
|
template<typename T>
|
|
|
|
SPROUT_CONSTEXPR typename eval<
|
2013-03-24 08:07:20 +00:00
|
|
|
typename sprout::remove_shallow_cvref<T>::type
|
2013-03-26 17:02:16 +00:00
|
|
|
>::result_type
|
|
|
|
operator()(T&& t) const {
|
2013-03-24 08:07:20 +00:00
|
|
|
typedef eval<typename sprout::remove_shallow_cvref<T>::type> eval_type;
|
2011-11-13 08:54:38 +00:00
|
|
|
return eval_type()(sprout::forward<T>(t));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
//
|
|
|
|
// lit
|
|
|
|
//
|
|
|
|
SPROUT_STATIC_CONSTEXPR sprout::weed::lit_g lit = sprout::weed::lit_g();
|
|
|
|
} // namespace weed
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_WEED_PARSER_LIT_HPP
|