c++11模拟boost元占位符(三)

2015-01-27 14:02:54 · 作者: · 浏览: 57
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? };
?
#define SUPPORT_LAMBDA_4_IMPL(classname, A1, A2, A3, A4) ? ? ? ? ? ? ? ? ? ?\
? ? template<> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? struct classname##< A1, A2, A3, A4 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? template ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? struct apply ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? using type = typename classname##< ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A1::apply::type, ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A2::apply::type, ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A3::apply::type ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A4::apply::type>::type; ? ? ? ? ? ? ? ? ? ?\
? ? ? ? }; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? };
?
#define SUPPORT_LAMBDA_5_IMPL(classname, A1, A2, A3, A4, A5) ? ? ? ? ? ? ? ?\
? ? template<> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? struct classname##< A1, A2, A3, A4, A5 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? template ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? struct apply ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? using type = typename classname##< ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A1::apply::type, ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A2::apply::type, ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A3::apply::type ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A4::apply::type ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? ? ?typename A5::apply::type>::type; ? ? ? ? ? ? ? ? ? ?\
? ? ? ? }; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? };
?
?
#define SUPPORT_LAMBDA_1(classname, P) ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_1_IMPL(classname, P##1)
?
#define SUPPORT_LAMBDA_2(classname, P) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? ? ? ? ? SUPPORT_LAMBDA_2_IMPL(classname, P##1, P##2) ? ? ? ? ?\
? ? ? ? ? ? SUPPORT_LAMBDA_2_IMPL(classname, P##2, P##1)
?
#define SUPPORT_LAMBDA_3(classname, P) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_3_IMPL(classname, P##1, P##2, P##3) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_3_IMPL(classname, P##1, P##3, P##2) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_3_IMPL(classname, P##2, P##1, P##3) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_3_IMPL(classname, P##2, P##3, P##1) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_3_IMPL(classname, P##3, P##1, P##2) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_3_IMPL(classname, P##3, P##2, P##1)
?
#define SUPPORT_LAMBDA_4(classname, P) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##1, P##2, P##3, P##4) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##1, P##2, P##4, P##3) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##1, P##3, P##2, P##4) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##1, P##3, P##4, P##2) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##1, P##4, P##3, P##2) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##1, P##4, P##2, P##3) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##2, P##1, P##3, P##4) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##2, P##1, P##4, P##3) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##2, P##3, P##1, P##4) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##2, P##3, P##4, P##1) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##2, P##4, P##1, P##3) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##2, P##4, P##3, P##1) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##3, P##1, P##2, P##4) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##3, P##1, P##4, P##2) ? ? ? ? ? ?\
? ? SUPPORT_LAMBDA_4_IMPL(classname, P##3