{
namespace _nest_type
{
+ template <typename _NextType>
+ class _next_type_impl { public: _NextType next; };
+ template <>
+ class _next_type_impl<EmptyType> {};
+
// _NNextType Implement is outer class.
// (because compile error when _NextType is EmptyType...)
/////////////////////////////////////////////////////////////////////////////////////////////
template <typename _ThisType, typename _NextType=EmptyType>
- class nest_type
+ class nest_type : public tp::_nest_type::_next_type_impl<_NextType>
{
public:
// typedefs
// Values
_ThisType value;
- _NextType next;
+ //_NextType next;
public:
/// Constructors //////////////////////////////////////////////////////////////////
{
using namespace roast;
- nest_type<int,nest_type<float> > a;
+ typedef nest_type<int,nest_type<int> > MyNestType;
+ MyNestType a;
//a.value = 10;
//a.next.value = 20.0f;
//a.right<0>().value = 10;
nest_type<int,nest_type<float> >::_NGetType<0>::type a1 = 10.0f;
nest_type<int,nest_type<float> >::_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;