//Following copied then maybe modifed from: /* From: Jeremiah Willcock Newsgroups: gmane.comp.lib.boost.user Subject: Re: challange to MPL gurus Date: Mon, 12 Dec 2011 17:39:44 -0500 (EST) */ #include #include #include #include #include #include #include #include #include namespace boost{namespace mpl{ template struct ForwardIterator; template struct check_unless_end {}; template struct check_unless_end { typedef typename boost::mpl::deref::type t1; typedef typename boost::mpl::next::type t2; BOOST_CONCEPT_ASSERT(( ForwardIterator )); }; template struct ForwardIterator { #if 1 typedef typename boost::mpl::print< I >::type t1; #endif typedef check_unless_end< I, boost::is_same< boost::mpl::l_iter, I > > t2; BOOST_MPL_ASSERT(( boost::is_convertible< typename I::category, boost::mpl::forward_iterator_tag > )); }; template struct ForwardSequence { typedef typename boost::mpl::end::type t2; BOOST_CONCEPT_ASSERT(( ForwardIterator )); }; #include void test_list_sequence(){ BOOST_CONCEPT_ASSERT(( ForwardSequence< boost::mpl::list > )); } }}