• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

C++ベースのLightweightなHTTPサーバー


Commit MetaInfo

Revision3c4fb39a483a150f8a1b203db8fd5e112d8ef323 (tree)
Time2013-03-17 13:48:50
AuthorMichio Hirai <smg_ykz@user...>
CommiterMichio Hirai

Log Message

[Refactor] Addition of mt:Select metafunction
[Refactor] Further refinement of mt::Append metafunction

Change Summary

Incremental Difference

--- a/inc/mt_mpl.h
+++ b/inc/mt_mpl.h
@@ -26,6 +26,18 @@ struct StaticValue
2626 static const T value = val;
2727 };
2828
29+template <bool cond, typename Then, typename Else>
30+struct Select
31+{
32+ typedef Else Result;
33+};
34+
35+template <typename Then, typename Else>
36+struct Select<true, Then, Else>
37+{
38+ typedef Then Result;
39+};
40+
2941 } // namespace mt
3042
3143 #endif // INC_MT_MPL_H_
--- a/inc/mt_sfinae.h
+++ b/inc/mt_sfinae.h
@@ -17,6 +17,12 @@ struct YesTypeWith1TemplateParam
1717 YesType dummy;
1818 };
1919
20+template <typename T, typename ARG1, typename ARG2>
21+struct YesTypeWith2TemplateParam
22+{
23+ YesType dummy;
24+};
25+
2026 template <typename T, typename R, R (T::*)()>
2127 struct YesTypeWithNonConstMemberMethodNoArg
2228 {
--- a/inc/mt_typelist.h
+++ b/inc/mt_typelist.h
@@ -39,15 +39,18 @@ struct MakeTypelist<T, NullType>
3939 };
4040
4141 template <typename TL, typename T>
42-struct Append
42+struct Append;
43+
44+template <typename T, typename U, typename V>
45+struct Append<Typelist<T, U>, V>
4346 {
44- typedef Typelist<typename TL::Head, typename Append<typename TL::Tail, T>::Result > Result;
47+ typedef Typelist<T, typename Append<U, V>::Result > Result;
4548 };
4649
47-template <typename T, typename U>
48-struct Append<Typelist<T, NullType>, U>
50+template <typename T>
51+struct Append<NullType, T>
4952 {
50- typedef Typelist<T, U> Result;
53+ typedef Typelist<T, NullType> Result;
5154 };
5255
5356 template <typename TL, typename T>