From 60c757d78c07c0e166326990ae53d86919da5f24 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Sun, 26 Jun 2011 16:44:11 +0900 Subject: [PATCH] =?utf8?q?nest=5Ftype.hpp:=20=5FNextType=20next=20?= =?utf8?q?=E3=81=AF=E3=81=93=E3=81=AE=E5=AE=9F=E8=A3=85=E3=81=A7=E3=82=82?= =?utf8?q?=E3=81=84=E3=81=91=E3=82=8B=E3=81=8B=E3=83=BB=E3=83=BB=E3=83=BB?= =?utf8?q?=EF=BC=9F=EF=BC=88=E6=9C=AC=E5=BD=93=E3=83=BB=E3=83=BB=E3=83=BB?= =?utf8?q?=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/tp/nest_type.hpp | 9 +++++++-- roast/test/roast_test_3rd/tuple_test3.cpp | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/roast/include/roast/tp/nest_type.hpp b/roast/include/roast/tp/nest_type.hpp index 5d12df6a..778a14dc 100644 --- a/roast/include/roast/tp/nest_type.hpp +++ b/roast/include/roast/tp/nest_type.hpp @@ -13,6 +13,11 @@ namespace roast { namespace _nest_type { + template + class _next_type_impl { public: _NextType next; }; + template <> + class _next_type_impl {}; + // _NNextType Implement is outer class. // (because compile error when _NextType is EmptyType...) @@ -30,7 +35,7 @@ namespace roast ///////////////////////////////////////////////////////////////////////////////////////////// template - class nest_type + class nest_type : public tp::_nest_type::_next_type_impl<_NextType> { public: // typedefs @@ -51,7 +56,7 @@ namespace roast // Values _ThisType value; - _NextType next; + //_NextType next; public: /// Constructors ////////////////////////////////////////////////////////////////// diff --git a/roast/test/roast_test_3rd/tuple_test3.cpp b/roast/test/roast_test_3rd/tuple_test3.cpp index 545df6cf..e805bcbd 100644 --- a/roast/test/roast_test_3rd/tuple_test3.cpp +++ b/roast/test/roast_test_3rd/tuple_test3.cpp @@ -8,7 +8,8 @@ void main() { using namespace roast; - nest_type > a; + typedef nest_type > MyNestType; + MyNestType a; //a.value = 10; //a.next.value = 20.0f; //a.right<0>().value = 10; @@ -22,7 +23,7 @@ void main() nest_type >::_NGetType<0>::type a1 = 10.0f; nest_type >::_NGetType<1>::type a2 = a1; - printf("%d, %f, %f\n", a.value, a.next.value, b.value ); + printf("(%d) %d, %f, %f\n", sizeof(MyNestType), a.value, a.next.value, b.value ); /* int add_result, sub_result, mul_result, div_result; -- 2.11.0