//////////////////////////////////////////////////////////////
//
//	繰り返しを行うマクロ
//
//////////////////////////////////////////////////////////////

#ifndef __MYU_STANDARD_LIBRARY__msl_tuple_H__
#define __MYU_STANDARD_LIBRARY__msl_tuple_H__

#include "msl_pp.h"

#define _MSL_TUPLE_MAX	64		//	括弧で囲ってはいけない！

//#define _MSL_TUPLE_TYPENAME_(X)			typename T ##X = _MSL_EMPTY_STRUCT
#define _MSL_TUPLE_TYPENAME_(X)			typename T##X
//#define _MSL_TUPLE_DEFINE_VALUE_(X)	T##X v##X;
#define _MSL_TUPLE_DEFINE_VALUE_(X)		int v##X;
#define _MSL_TUPLE_FUNC_PARAMS_(X)		T##X v##X

//typedef struct {} _MSL_EMPTY_STRUCT;
struct _MSL_EMPTY_STRUCT {};

//////////////////////////////////////////////////////////////

#pragma warning( disable : 4786 )

/*
template< MSL_PP_COMMA_REPEART_INC(_MSL_TUPLE_MAX, _MSL_TUPLE_TYPENAME_) >
class CMyuTuple
{
protected:
	MSL_PP_REPEART_INC(_MSL_TUPLE_MAX, _MSL_TUPLE_DEFINE_VALUE_)
	
public:
	//	コンストラクタ・デストラクタ
	CMyuTuple(){}
	virtual ~CMyuTuple(){}
};
*/
//		MSL_PP_REPEART_INC(X, _MSL_TUPLE_DEFINE_VALUE_)	

//#define AAAA	MSL_PP_COMMA_REPEART_INCx(2,_MSL_TUPLE_DEFINE_VALUE_)
#define AAAA_(X)	MSL_PP_COMMA_REPEART_INCx(2,_MSL_TUPLE_DEFINE_VALUE_)
#define AAAA	AAAA_(3)

#define HOGE(X)		int hoge ##X;


#define ZZZZZZ__(X)		int v##X;
#define ZZZZZZ_(X)		ZZZZZZ__(X)
#define ZZZZZZ(X)		ZZZZZZ_(X)

//MSL_PP_REPEART_INC(3,HOGE)
//#define QQQQ(X)		MSL_PP_REPEART_INC(X, ZZZZZZ)
#define QQQQ(X)			AAAAA(ZZZZZZ)
#define QQQQ_(X)		QQQQ(X)
//QQQQ(3)

#define AAAAA(callback)		callback(1)

//AAAAA(QQQQ_)


#define MSL_PP_COMMA_REPEART_INCx(x,callback)		MSL_PP_COMMA_REPEART_INC_(x,callback)

#define _MSL_TUPLE_X(X,not_used)	\
	template< MSL_PP_COMMA_REPEART_INC(X, _MSL_TUPLE_TYPENAME_) >	\
	class CMyuTuple ##X	\
	{	\
	protected:	\
		MSL_PP_REPEART_INC(X, _MSL_TUPLE_DEFINE_VALUE_)	\
	\
	public:	\
		/*	コンストラクタ・デストラクタ */		\
		CMyuTuple ##X(){}	\
		virtual ~CMyuTuple ##X(){}	\
	};

MSL_PP_REPEART_INC_2(4, _MSL_TUPLE_X, 0)

#endif//__MYU_STANDARD_LIBRARY__msl_tuple_H__