// typedefs
typedef _ThisType _Value, _ValueType, ValueType;
typedef _NextType _Next, _ChildType;
- typedef nest_type<_ThisType,_NextType> _ThisTupleType, _THIS_TUPLE_T;
+ typedef nest_type<_ThisType,_NextType> _ThisClassType;
// Values
_ThisType value;
nest_type(_ValueType value_in, _NextType next_in)
: value(value_in), next(next_in) {}
- nest_type( const _THIS_TUPLE_T &t )
+ nest_type( const _ThisClassType &t )
: value(t.value), next(t.next) {}
////////////////////////////////////////////////////////////////////////
- template <typename _OTHER_TUPLE_T>
- nest_type& operator = (_OTHER_TUPLE_T &t)
+ // Copy from Other nest_type. (but nearly or convertible)
+ template <typename _OtherNestType>
+ nest_type& operator = (_OtherNestType &t)
{
value = t.value;
next = t.next;
}
// right
- template <int N, typename _TUPLE_T>
+ /*template <int N, typename _TUPLE_T>
struct tuple_right_t
{
typedef typename tuple_right_t<N-1, typename _TUPLE_T::_RIGHT>::_Type _Type;
struct tuple_right_t<0, _TUPLE_T>
{
typedef _TUPLE_T _Type;
- };
- template <int N> struct _RightType{ typedef typename tuple_right_t<N,_THIS_TUPLE_T>::_Type _Type; };
- template <int N> typename _RightType<N>::_Type right() { return tuple_right<N,_THIS_TUPLE_T>(*this); }
+ };*/
+
+ template <int N> struct _RightType{ typedef typename tuple_right_t<N,_ThisClassType>::_Type _Type; };
+ template <> struct<0> _RightType{ typedef typename tuple_right_t<N,_ThisClassType>::_Type _Type; };
+
+ template <int N> typename _RightType<N>::_Type right() { return tuple_right<N,_ThisClassType>(*this); }
// get
template <int N> typename _RightType<N-1>::_Type::_VALUE get() { return right<N-1>().value; }
// left
- template <int N> struct _LeftType{ typedef typename tuple_left_t<N,_THIS_TUPLE_T>::_Type _Type; };
- template <int N> typename _LeftType<N>::_Type left(){ return tuple_left<N,_THIS_TUPLE_T>(*this); }
+ template <int N> struct _LeftType{ typedef typename tuple_left_t<N,_ThisClassType>::_Type _Type; };
+ template <int N> typename _LeftType<N>::_Type left(){ return tuple_left<N,_ThisClassType>(*this); }
/////////////////////////////////////////////////////////////////////////////////////
template <typename APPEND_TUPLE_T> typename _CombineType<APPEND_TUPLE_T>::_Type operator +(const APPEND_TUPLE_T& append_tuple){ return tuple_combine(*this, append_tuple); }
// operator =
- _THIS_TUPLE_T operator = ( const _THIS_TUPLE_T &from )
+ _ThisClassType operator = ( const _ThisClassType &from )
{
this->value = from.value;
this->next = from.next;
public:
// typedefs
typedef T_FIRST _T_FIRST, _FIRST_T, _FIRST, _VALUE, _VALUE_T;
- typedef nest_type<T_FIRST> _THIS_TUPLE_T;
+ typedef nest_type<T_FIRST> _ThisClassType;
////////////////////////////////////////////////////////////////////////////////////////
public:
////////////////////////////////////////////////////////////////////////////////////
- nest_type( const _THIS_TUPLE_T &t )
+ nest_type( const _ThisClassType &t )
: value(t.value) {}
nest_type(_FIRST_T first_in) : value(first_in) {}
}
// right
- template <int N> struct _RightType{ typedef typename tuple_right_t<N,_THIS_TUPLE_T>::_Type _Type; };
- template <int N> typename _RightType<N>::_Type right() { return tuple_right<N,_THIS_TUPLE_T>(*this); }
+ template <int N> struct _RightType{ typedef typename tuple_right_t<N,_ThisClassType>::_Type _Type; };
+ template <int N> typename _RightType<N>::_Type right() { return tuple_right<N,_ThisClassType>(*this); }
// get
template <int N> typename _RightType<N-1>::_Type::_VALUE get() { return right<N-1>().value; }
// left
- template <int N> struct _LeftType{ typedef typename tuple_left_t<N,_THIS_TUPLE_T>::_Type _Type; };
- template <int N> typename _LeftType<N>::_Type left(){ return tuple_left<N,_THIS_TUPLE_T>(*this); }
+ template <int N> struct _LeftType{ typedef typename tuple_left_t<N,_ThisClassType>::_Type _Type; };
+ template <int N> typename _LeftType<N>::_Type left(){ return tuple_left<N,_ThisClassType>(*this); }
/////////////////////////////////////////////////////////////////////////////////////
template <typename APPEND_TUPLE_T> typename _CombineType<APPEND_TUPLE_T>::_Type operator +(const APPEND_TUPLE_T& append_tuple){ return tuple_combine(*this, append_tuple); }
// operator =
- _THIS_TUPLE_T operator = ( const _THIS_TUPLE_T &from )
+ _ThisClassType operator = ( const _ThisClassType &from )
{
this->value = from.value;
return *this;