[vs 2005]_Ptr_cat


//  
template<class _T1, class _T2> inline 
typename _Ptr_cat_helper<_T1, _T2>::_Ptr_cat _Ptr_cat(_T1&, _T2&)
{
	//  _Ptr_cat_helper ,_Ptr_cat_helper 。
	typename _Ptr_cat_helper<_T1, _T2>::_Ptr_cat _Cat;
	return (_Cat);
}

//  _Ptr_cat_helper
template<class _T1,	class _T2>
struct _Ptr_cat_helper
{
	//  _Ptr_cat_helper _Ptr_cat_with_checked_cat_helper 
	typedef typename _Ptr_cat_with_checked_cat_helper<_T1, _T2, 
		typename _Checked_iterator_category<_T1>::_Checked_cat,
		typename _Checked_iterator_category<_T2>::_Checked_cat>::_Ptr_cat _Ptr_cat;
};

//   _Ptr_cat_with_checked_cat_helper    
template<class _T1, class _T2, class _Checked_Cat1, class _Checked_Cat2>
struct _Ptr_cat_with_checked_cat_helper
{
	typedef _Nonscalar_ptr_iterator_tag _Ptr_cat;
};

template<class _T1,	class _T2, class _Checked_Cat1>
struct _Ptr_cat_with_checked_cat_helper<_T1, _T2, _Checked_Cat1, _Range_checked_iterator_tag>
{
	typedef typename _Ptr_cat_helper<_T1, typename _T2::_Inner_type>::_Ptr_cat _Ptr_cat;
};

template<class _T1,	class _T2, class _Checked_Cat2>
struct _Ptr_cat_with_checked_cat_helper<_T1, _T2, _Range_checked_iterator_tag, _Checked_Cat2>
{
	typedef typename _Ptr_cat_helper<typename _T1::_Inner_type, _T2>::_Ptr_cat _Ptr_cat;
};

template<class _T1,	class _T2>
struct _Ptr_cat_with_checked_cat_helper<_T1, _T2, _Range_checked_iterator_tag, _Range_checked_iterator_tag>
{
	typedef typename _Ptr_cat_helper<typename _T1::_Inner_type, typename _T2::_Inner_type>::_Ptr_cat _Ptr_cat;
};


//  _Ptr_cat_helper 
template<class _T1>
struct _Ptr_cat_helper<_T1, _Undefined_inner_type_tag>
{
	typedef _Nonscalar_ptr_iterator_tag _Ptr_cat;
};

template<class _T2>
struct _Ptr_cat_helper<_Undefined_inner_type_tag, _T2>
{
	typedef _Nonscalar_ptr_iterator_tag _Ptr_cat;
};

template<>
struct _Ptr_cat_helper<_Undefined_inner_type_tag, _Undefined_inner_type_tag>
{
	typedef _Nonscalar_ptr_iterator_tag _Ptr_cat;
};

		// INTEGER FUNCTION _Ptr_cat
template<>
struct _Ptr_cat_helper<_Bool *, _Bool *>
{	// return pointer category from pointer to pointer arguments
	typedef _Scalar_ptr_iterator_tag _Ptr_cat;
};

template<>
struct _Ptr_cat_helper<const _Bool *, _Bool *>
{	// return pointer category from pointer to pointer arguments
	typedef _Scalar_ptr_iterator_tag _Ptr_cat;
};