亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? operators.hpp

?? 國外魔獸世界-NOPserver源碼,2004年版
?? HPP
字號:
// Copyright (c) 2003 Daniel Wallin and Arvid Norberg

// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.


#if !BOOST_PP_IS_ITERATING

#ifndef LUABIND_OPERATORS_HPP_INCLUDED
#define LUABIND_OPERATORS_HPP_INCLUDED

#include <luabind/config.hpp>

#include <sstream>

#include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/iteration.hpp>


#include <boost/mpl/if.hpp>
#include <boost/mpl/vector.hpp>

#include <luabind/detail/other.hpp>
#include <luabind/detail/operator_id.hpp>
#include <luabind/detail/signature_match.hpp>
#include <luabind/detail/policy.hpp>

namespace luabind { namespace detail {


	template<int N> struct execute_selector;

	template<class T>
	struct policies_with_storage : T
	{
		char storage;
	};

#if defined (BOOST_MSVC) && (BOOST_MSVC <= 1200)
	#define LUABIND_MSVC6_NO_TYPENAME
#else
	#define LUABIND_MSVC6_NO_TYPENAME typename
#endif

//#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
	#define LUABIND_CONVERT_PARAMETER conv_self.apply(L, LUABIND_DECORATE_TYPE(Self&), 1)
//#else
//	#define LUABIND_CONVERT_PARAMETER conv_self::template apply<Self_>(L, LUABIND_DECORATE_TYPE(Self&), 1)
//#endif


	#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/detail/operators.hpp>, 1))
	#include BOOST_PP_ITERATE()

	#define LUABIND_UNWRAP_PARAM(z,n,_) LUABIND_MSVC6_NO_TYPENAME unwrap_other<A##n>::type

	// Signature is a constructor<...> with all the parameter types in it
	// constant is true if the application operator is const
	template<class Signature, bool Constant, class Policies = null_type>
	struct application_operator
	{
		template<class Self>
		struct apply: execute_selector<Signature::arity>::template apply<Signature, Constant, Self, Policies> {};

		template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)>
		static inline int match_impl(
					lua_State* L,
					const constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)>*)
		{
			typedef constructor<BOOST_PP_ENUM(LUABIND_MAX_ARITY, LUABIND_UNWRAP_PARAM, _)> unwrapped_sig;

			object_rep* obj = is_class_object(L, 1);
			if (obj == 0) return -1;

			bool constant_obj = obj->flags() & object_rep::constant;

			if (!Constant && constant_obj) return -1;
//			if (lua_gettop(L) != Signature::arity + 1) return -1;

			int i = match_params(L, 2, static_cast<const unwrapped_sig*>(0), static_cast<const Policies*>(0));
			if (Constant && !constant_obj) i++;
			return i;
		}

		static inline int match(lua_State* L)
		{
			return match_impl(L, static_cast<const Signature*>(0));
		}
	};

	#undef LUABIND_UNWRAP_PARAM

	// this is the type that represents all the operators
	// this is returned from all operators on self_t
	template<class id, class L, class R = null_type>
	struct operator_
	{
	};
	
	struct self_t : boost::arg<-1>
	{
		#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/detail/operators.hpp>, 2))
		#include BOOST_PP_ITERATE()

		operator_<op_tostring_tag, self_t, null_type> tostring;
	};

	struct const_self_t : boost::arg<-1>
	{
		#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/detail/operators.hpp>, 3))
		#include BOOST_PP_ITERATE()

		operator_<op_tostring_tag, const_self_t, null_type> tostring;
	};

	// TODO: fix this. The type cannot be a value type for all cases
	template<class T, class Policy>
	inline int convert_result(lua_State* L, T v, const Policy*)
	{
		typedef typename find_conversion_policy<0, Policy>::type converter_policy;
		typename converter_policy::template generate_converter<T, cpp_to_lua>::type ret_converter;
		ret_converter.apply(L, v);
		return 1;
	}

	// this is an implementation that is specialized
	// for each operator and used by operator_
	template<class id>
	struct binary_operator
	{
		template<class Policies, class Left, class Right>
		struct impl;
	};

	template<class id>
	struct unary_operator
	{
		template<class Policies, class Left> struct impl;
	};

	template<class Policies, class id, class Self, class L, class R = null_type>
	struct operator_unwrapper :
		::boost::mpl::if_<
			::boost::is_same<detail::null_type, R>,
			// if this is true, it is a unary operator
			typename unary_operator<id>::template impl<
				Policies,
				typename ::boost::mpl::if_<
					boost::is_same<detail::self_t, L>,
					Self&,
					typename ::boost::mpl::if_<
						::boost::is_same<detail::const_self_t, L>,
						const Self&,
						typename unwrap_other<L>::type
					>::type
				>::type
			>,
			// else, if this is a binary operator	
			typename binary_operator<id>::template impl<
				Policies,
				// extract the left type and substitute self_t and const_self_t with the real self type
				// also, unwrap the type if it's wrapped in other<>
				typename ::boost::mpl::if_<
					boost::is_same<detail::self_t, L>,
					Self&,
					typename ::boost::mpl::if_<
						::boost::is_same<detail::const_self_t, L>,
						const Self&,
						typename unwrap_other<L>::type>::type
					>::type,
				// same thing but with the right type
				typename ::boost::mpl::if_<
					boost::is_same<detail::self_t, R>,
					Self&,
					typename ::boost::mpl::if_<
						::boost::is_same<detail::const_self_t, R>,
						const Self&,
						typename unwrap_other<R>::type
					>::type
				>::type
			>
		>::type 
	{};
}}

namespace luabind
{
	namespace
	{
		LUABIND_ANONYMOUS_FIX detail::self_t self;
		LUABIND_ANONYMOUS_FIX detail::const_self_t const_self;
	}

#define LUABIND_BINARY_OPERATOR(id, op)\
	namespace detail {\
 		template<>\
		struct binary_operator<op_##id##_tag>\
 		{\
 			template<class Policies, class Left, class Right>\
 			struct impl\
 			{\
				typedef typename unwrap_other<Left>::type left_t; \
				typedef typename unwrap_other<Right>::type right_t; \
				static inline operator_id get_id() { return op_##id; } \
 				static inline int execute(lua_State* L)\
 				{\
					typedef typename find_conversion_policy<1, Policies>::type converter_policy_left; \
					typename converter_policy_left::template generate_converter<left_t, lua_to_cpp>::type converter_left; \
					typedef typename find_conversion_policy<2, Policies>::type converter_policy_right; \
					typename converter_policy_right::template generate_converter<right_t, lua_to_cpp>::type converter_right; \
					int ret = convert_result(L, converter_left.apply(L, LUABIND_DECORATE_TYPE(left_t), 1) op converter_right.apply(L, LUABIND_DECORATE_TYPE(right_t), 2), static_cast<const Policies*>(0));\
					return ret;\
 				}\
 				static int match(lua_State* L)\
 				{\
					return match_params(L, 1, static_cast<constructor<left_t, right_t>*>(0), static_cast<Policies*>(0));\
				}\
			};\
 		};\
	}\
	\
	namespace detail\
	{\
	inline detail::operator_<detail::op_##id##_tag, detail::self_t, detail::self_t> operator op(const detail::self_t&, const detail::self_t&)\
	{\
		return detail::operator_<detail::op_##id##_tag, detail::self_t, detail::self_t>();\
	}\
	template<class L>\
	inline detail::operator_<detail::op_##id##_tag, L, detail::self_t> operator op(const L&, const detail::self_t&)\
	{\
		return detail::operator_<detail::op_##id##_tag, L, detail::self_t>();\
	}\
	template<class R>\
	inline detail::operator_<detail::op_##id##_tag, detail::self_t, R> operator op(const detail::self_t&, const R&)\
	{\
		return detail::operator_<detail::op_##id##_tag, detail::self_t, R>();\
	}\
	inline detail::operator_<detail::op_##id##_tag, detail::const_self_t, detail::const_self_t> operator op(const detail::const_self_t&, const detail::const_self_t&)\
	{\
		return detail::operator_<detail::op_##id##_tag, detail::const_self_t, detail::const_self_t>();\
	}\
	template<class L>\
	inline detail::operator_<detail::op_##id##_tag, L, detail::const_self_t> operator op(const L&, const detail::const_self_t&)\
	{\
		return detail::operator_<detail::op_##id##_tag, L, detail::const_self_t>();\
	}\
	template<class R>\
	inline detail::operator_<detail::op_##id##_tag, detail::const_self_t, R> operator op(const detail::const_self_t&, const R&)\
	{\
		return detail::operator_<detail::op_##id##_tag, detail::const_self_t, R>();\
	}\
	}

	LUABIND_BINARY_OPERATOR(add,+)
	LUABIND_BINARY_OPERATOR(sub,-)
	LUABIND_BINARY_OPERATOR(div,/)
	LUABIND_BINARY_OPERATOR(mul,*)
	LUABIND_BINARY_OPERATOR(pow,^)
	LUABIND_BINARY_OPERATOR(lt,<)
	LUABIND_BINARY_OPERATOR(le,<=)
	LUABIND_BINARY_OPERATOR(eq,==)

#undef LUABIND_BINARY_OPERATOR


#define LUABIND_UNARY_OPERATOR(id, op)\
	namespace detail\
	{\
		template<>\
		struct unary_operator<op_##id##_tag>\
		{\
			template<class Policies, class Left>\
			struct impl\
			{\
				typedef typename unwrap_other<Left>::type left_t;\
				typedef detail::null_type right_t;\
				static inline operator_id get_id() { return op_##id; }\
				static inline int execute(lua_State* L)\
				{\
					typedef typename find_conversion_policy<1, Policies>::type converter_policy_left; \
					typename converter_policy_left::template generate_converter<left_t, lua_to_cpp>::type converter_left;\
					return convert_result(L, op converter_left.apply(L, LUABIND_DECORATE_TYPE(left_t), 1), static_cast<const Policies*>(0));\
				}\
				static inline int match(lua_State* L)\
				{\
					return match_params(L, 1, static_cast<constructor<left_t>*>(0), static_cast<Policies*>(0));\
				}\
			};\
		};\
	}\
	\
	inline detail::operator_<detail::op_##id##_tag, detail::self_t, detail::null_type> operator op(const detail::self_t&)\
	{\
		return detail::operator_<detail::op_##id##_tag, detail::self_t, detail::null_type>();\
	}\
	inline detail::operator_<detail::op_##id##_tag, detail::const_self_t, detail::null_type> operator op(const detail::const_self_t&)\
	{\
		return detail::operator_<detail::op_##id##_tag, detail::const_self_t, detail::null_type>();\
	}

	LUABIND_UNARY_OPERATOR(unm,-);

	namespace detail
	{
		template<>
		struct unary_operator<op_tostring_tag>
		{
			template<class Policies, class Left>
			struct impl
			{
				typedef typename unwrap_other<Left>::type left_t;
				typedef detail::null_type right_t;
				static inline operator_id get_id() { return op_tostring; }
				static inline int execute(lua_State* L)
				{
					// TODO: Should policies apply to this operator? shouldn't the string returntype be enforced?
					typedef typename find_conversion_policy<1, Policies>::type converter_policy_left;
					typename converter_policy_left::template generate_converter<left_t, lua_to_cpp>::type converter_left;
					std::stringstream s;
					s << converter_left.apply(L, LUABIND_DECORATE_TYPE(left_t), 1) << std::ends;
					return convert_result(L, s.str(), static_cast<const Policies*>(0));
				}
				static inline int match(lua_State* L)
				{
					return match_params(L, 1, static_cast<constructor<left_t>*>(0), static_cast<Policies*>(0));
				}
			};
		};
	}

	inline detail::operator_<detail::op_tostring_tag, detail::self_t, detail::null_type> tostring(const detail::self_t&)
	{
		return detail::operator_<detail::op_tostring_tag, detail::self_t, detail::null_type>();
	}
	inline detail::operator_<detail::op_tostring_tag, detail::const_self_t, detail::null_type> tostring(const detail::const_self_t&)
	{
		return detail::operator_<detail::op_tostring_tag, detail::const_self_t, detail::null_type>();
	}


#undef LUABIND_UNARY_OPERATOR
#undef LUABIND_MSVC6_NO_TYPENAME
}

#endif // LUABIND_OPERATORS_HPP_INCLUDED


#elif BOOST_PP_ITERATION_FLAGS() == 1

#define LUABIND_DECL(z,n,_) typedef typename find_conversion_policy<n + 1, Policies>::type BOOST_PP_CAT(converter_policy,n); \
		typedef typename unwrap_other<A##n>::type unwrapped_a##n; \
		typename BOOST_PP_CAT(converter_policy,n)::template generate_converter<unwrapped_a##n, lua_to_cpp>::type BOOST_PP_CAT(c,n);

#define LUABIND_PARAM(z,n,_) BOOST_PP_CAT(c,n).apply(L, LUABIND_DECORATE_TYPE(unwrapped_a##n), n+2)

	template<>
	struct execute_selector<BOOST_PP_ITERATION()>
	{
		template<class Signature, bool Constant, class Self_, class Policies>
		struct apply
		{
			static inline int execute(lua_State* L)
			{
				return execute_impl(L, static_cast<const Signature*>(0));
			}

			template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)>
			static inline int execute_impl(
						lua_State* L,
						const constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)>*)
			{
				// TODO: use policies here, instead of default_policy, or shouldn't we?
				typename boost::mpl::apply_if_c<Constant,
					LUABIND_MSVC6_NO_TYPENAME default_policy::template generate_converter<const Self_&, lua_to_cpp>,
					LUABIND_MSVC6_NO_TYPENAME default_policy::template generate_converter<Self_&, lua_to_cpp>
				>::type conv_self;

				typedef typename boost::mpl::if_c<Constant,
					const Self_,
					Self_
				>::type Self;

				BOOST_PP_REPEAT(BOOST_PP_ITERATION(), LUABIND_DECL, _)

				return convert_result(L, conv_self.apply(L, LUABIND_DECORATE_TYPE(Self&), 1)
					(
						BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_PARAM, _)
					), static_cast<Policies*>(0));
			}
		};
	};

#undef LUABIND_DECL
#undef LUABIND_PARAM

#elif BOOST_PP_ITERATION_FLAGS() == 2 // self_t

#define LUABIND_UNWRAP_PARAM(z,n,_) A##n

#if BOOST_PP_ITERATION() > 0
template<BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
#endif
application_operator< constructor<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_UNWRAP_PARAM, _)>, false>*
operator()(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)) { return 0; }

#undef LUABIND_UNWRAP_PARAM

#elif BOOST_PP_ITERATION_FLAGS() == 3 // const_self_t

#define LUABIND_UNWRAP_PARAM(z,n,_) A##n

#if BOOST_PP_ITERATION() > 0
template<BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
#endif
application_operator< constructor<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_UNWRAP_PARAM, _)>, true>*
operator()(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)) { return 0; }

#undef LUABIND_UNWRAP_PARAM

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产手机| 国产一区二区三区不卡在线观看 | 国产a视频精品免费观看| 国产精品丝袜一区| 久久精品国产成人一区二区三区 | 亚洲欧美视频在线观看视频| 丁香啪啪综合成人亚洲小说| 国产午夜亚洲精品午夜鲁丝片| 另类成人小视频在线| 26uuu成人网一区二区三区| 黄色日韩网站视频| 国产欧美综合色| 成人一区二区在线观看| 亚洲国产精品成人综合色在线婷婷 | 亚洲美女区一区| 日本二三区不卡| 亚洲亚洲人成综合网络| 欧美日韩激情一区| 免费观看久久久4p| 久久久久久免费毛片精品| 国产成人免费9x9x人网站视频| 国产精品拍天天在线| 色综合天天综合给合国产| 亚洲狠狠爱一区二区三区| 69堂亚洲精品首页| 亚洲va韩国va欧美va精品| 欧美一级电影网站| 国精产品一区一区三区mba桃花 | 精品免费视频.| 国产精品99久久久| 一区在线观看视频| 99国产一区二区三精品乱码| 亚洲综合免费观看高清完整版| 欧美夫妻性生活| 极品尤物av久久免费看| 久久青草欧美一区二区三区| 成人免费视频播放| 午夜日韩在线观看| 精品成人一区二区三区| 国产福利视频一区二区三区| 亚洲激情在线激情| 日韩女优av电影在线观看| jlzzjlzz亚洲日本少妇| 免费在线观看一区二区三区| 国产日韩欧美不卡在线| 欧美日韩卡一卡二| 成人综合婷婷国产精品久久 | 日韩一级高清毛片| 成人国产电影网| 亚洲精品成人在线| 26uuu久久天堂性欧美| 欧美日韩综合一区| 国内久久精品视频| 一区二区不卡在线播放 | 欧美日韩免费在线视频| 欧美国产一区在线| 久久精品国产一区二区| 99精品视频一区二区| 日韩精品电影一区亚洲| 欧美高清dvd| 色综合久久88色综合天天6| 久久99精品国产麻豆婷婷| 国产精品乱码久久久久久| 欧美日韩久久不卡| 99精品偷自拍| 亚洲电影你懂得| 欧美一二三区在线观看| 91福利在线播放| 99re视频这里只有精品| 成人在线综合网站| 国产九九视频一区二区三区| 老司机精品视频在线| 日本午夜一区二区| 日本亚洲三级在线| 日日夜夜精品免费视频| 一区二区理论电影在线观看| 综合久久久久久| 日韩一区日韩二区| 亚洲欧美综合色| 国产一区二区三区观看| 激情六月婷婷综合| 麻豆国产一区二区| 久久99蜜桃精品| 国产一区二区三区香蕉| 久久99日本精品| 国产乱码精品一区二区三| 国产一二精品视频| 国产精品123| 91在线视频免费91| 91国偷自产一区二区开放时间 | 午夜精品123| 亚洲6080在线| 青青草精品视频| 国产一区二区在线观看免费| 国产在线精品视频| 成人自拍视频在线观看| 91在线精品一区二区| 日本道精品一区二区三区| 欧美日本在线播放| 日韩欧美另类在线| 国产午夜精品久久久久久久| 国产精品久久网站| 亚洲国产欧美在线人成| 日韩精品成人一区二区三区| 国内精品国产三级国产a久久| 高清免费成人av| 欧美日韩一区二区三区四区五区| 欧美一级精品在线| 国产精品伦一区| 日韩精品电影在线观看| 国产suv精品一区二区三区| 91在线视频播放| 欧美精品三级在线观看| 国产亚洲综合在线| 亚洲专区一二三| 韩国欧美一区二区| 色乱码一区二区三区88| 精品国产三级电影在线观看| 中文字幕在线视频一区| 日韩高清一区在线| 成人18精品视频| 日韩欧美二区三区| 亚洲乱码一区二区三区在线观看| 日韩av电影天堂| av激情综合网| 欧美一级二级在线观看| 亚洲欧美电影一区二区| 免费av成人在线| 一本到不卡免费一区二区| 日韩精品一区二区三区四区 | 日本一区二区三级电影在线观看 | 国产亚洲1区2区3区| 亚洲自拍欧美精品| 成人美女视频在线观看| 欧美一区二区三区喷汁尤物| 最新高清无码专区| 久久99精品国产91久久来源| 色哟哟精品一区| 欧美激情综合五月色丁香小说| 亚洲v中文字幕| 99re热这里只有精品免费视频| 精品99999| 日本成人在线不卡视频| 91官网在线免费观看| 国产精品色在线观看| 精久久久久久久久久久| 欧美日韩精品欧美日韩精品| 亚洲色图一区二区| 国产99久久久久| 欧美成人精品高清在线播放 | 一区二区三区高清不卡| jvid福利写真一区二区三区| 精品国产一区二区在线观看| 日韩中文欧美在线| 欧美午夜精品久久久久久孕妇| 国产精品三级av在线播放| 国内外精品视频| 日韩欧美高清一区| 日韩和欧美一区二区三区| 欧美在线高清视频| 亚洲综合图片区| 欧美丝袜丝交足nylons| 亚洲美女精品一区| 91麻豆国产香蕉久久精品| 国产精品乱码妇女bbbb| 成人高清视频在线观看| 国产精品久久影院| 99久久综合99久久综合网站| 中文字幕亚洲区| 99久久婷婷国产精品综合| 国产精品美女久久久久久久| 国产成人免费视| 国产精品毛片a∨一区二区三区| 成人动漫中文字幕| 亚洲欧洲在线观看av| 91在线无精精品入口| 一区二区国产盗摄色噜噜| 在线观看网站黄不卡| 午夜不卡av免费| 911精品国产一区二区在线| 日韩精品国产欧美| 精品福利在线导航| 国产在线视频一区二区| 国产免费观看久久| 日本精品视频一区二区| 亚洲国产综合91精品麻豆| 777奇米四色成人影色区| 久久国产精品72免费观看| 国产女人18水真多18精品一级做| 波多野结衣中文一区| 一区二区三区高清| 日韩精品一区二区三区中文不卡 | 欧美乱妇一区二区三区不卡视频| 偷窥国产亚洲免费视频| 欧美精品一区视频| 9i在线看片成人免费| 天天av天天翘天天综合网| 欧美成人精品福利| 国产99久久久国产精品免费看| 亚洲欧美一区二区三区国产精品|