/************************************************************************ * * Licensed Materials - Property of IBM. * (C) Copyright IBM Corporation 2003, 2012. All Rights Reserved. * U.S. Government Users Restricted Rights: * Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. * ************************************************************************/ #ifndef __BOOST_EXT_LAMBDA_HPP_INCLUDE_88EE777E$60BD$4517$A330$AD2406108A1A_INCLUDE____ #define __BOOST_EXT_LAMBDA_HPP_INCLUDE_88EE777E$60BD$4517$A330$AD2406108A1A_INCLUDE____ #include "boost/mpl/has_xxx.hpp" #include "boost/utility/enable_if.hpp" namespace std{ namespace detail { namespace type_traits { template< typename T > struct org_type{ typedef T type; }; template< typename T > struct org_type{ typedef T type; }; template< typename T > struct org_type{ typedef T type; }; } BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category); BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type); BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type); BOOST_MPL_HAS_XXX_TRAIT_DEF(distance_type); BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer); BOOST_MPL_HAS_XXX_TRAIT_DEF(reference); using boost::enable_if; using boost::disable_if; template < template< typename > class TPtr, typename T, class Enable = void> class define_iterator_category; template < template< typename > class TPtr, typename T, class Enable = void> class define_value_type; template < template< typename > class TPtr, typename T, class Enable = void> class define_difference_type; template < template< typename > class TPtr, typename T, class Enable = void> class define_distance_type; template < template< typename > class TPtr, typename T, class Enable = void> class define_pointer; template < template< typename > class TPtr, typename T, class Enable = void> class define_reference; template class TPtr, typename T > struct define_iterator_category > >::type> { typedef typename TPtr::iterator_category iterator_category; }; template class TPtr, typename T > struct define_iterator_category > >::type> { typedef void iterator_category; }; template class TPtr, typename T > struct define_value_type > >::type> { typedef typename TPtr::value_type value_type; }; template class TPtr, typename T > struct define_value_type > >::type> { typedef typename type_traits::org_type::type value_type; }; template class TPtr, typename T > struct define_difference_type > >::type> { typedef typename TPtr::difference_type difference_type; }; template class TPtr, typename T > struct define_difference_type > >::type> { typedef void difference_type; }; template class TPtr, typename T > struct define_distance_type > >::type> { typedef typename TPtr::distance_type distance_type; }; template class TPtr, typename T > struct define_distance_type > >::type> { typedef void distance_type; }; template class TPtr, typename T > struct define_pointer > >::type> { typedef typename TPtr::pointer pointer; }; template class TPtr, typename T > struct define_pointer > >::type> { typedef typename type_traits::org_type::type * pointer; }; template class TPtr, typename T > struct define_reference > >::type> { typedef typename TPtr::reference reference; }; template class TPtr, typename T > struct define_reference > >::type> { typedef typename type_traits::org_type::type & reference; }; } template< template< typename > class TPtr, typename T >// TPtr is boost::shared_ptr / rtl::Reference, etc struct iterator_traits< TPtr > : detail::define_iterator_category< TPtr, T >, detail::define_value_type< TPtr, T >, detail::define_difference_type< TPtr, T >, detail::define_distance_type< TPtr, T >, detail::define_pointer< TPtr, T >, detail::define_reference< TPtr, T > { }; } namespace boost { template struct pointee; template < template< typename > class TPtr, typename T > struct pointee< TPtr< T > > { typedef typename std::iterator_traits< TPtr >::value_type type; }; } #endif