$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r52608 - sandbox/SOC/2009/fusion/mini-fusion
From: mr.chr.schmidt_at_[hidden]
Date: 2009-04-26 13:55:21
Author: cschmidt
Date: 2009-04-26 13:55:21 EDT (Sun, 26 Apr 2009)
New Revision: 52608
URL: http://svn.boost.org/trac/boost/changeset/52608
Log:
more comments on concepts
Text files modified: 
   sandbox/SOC/2009/fusion/mini-fusion/concepts.hpp |    31 ++++++++++++++++++-------------         
   1 files changed, 18 insertions(+), 13 deletions(-)
Modified: sandbox/SOC/2009/fusion/mini-fusion/concepts.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/mini-fusion/concepts.hpp	(original)
+++ sandbox/SOC/2009/fusion/mini-fusion/concepts.hpp	2009-04-26 13:55:21 EDT (Sun, 26 Apr 2009)
@@ -18,16 +18,18 @@
                 template<class Iterator,class IntegralConstant>
                         typename result_of::advance_c<Iterator,IntegralConstant::value>::type advance_c_test(const Iterator& iterator,IntegralConstant)
                 {
-			return advance_c<IntegralConstant::value>(iterator);
+			return advance_c<0>(iterator);
                 }
         }
 
+	//Fusion-iterators are defined through a set of (meta-)functions rather than their own public interface.
+	//That means we need to instantiate these functions in our concept with fitting arguments to check if
+	//the specified type models a valid fusion iterator.
         auto concept ForwardIterator<class Iterator,
-		class OtherIterator=Iterator,
-		int IntegralConstant=0> :
+		class OtherIterator=Iterator> :
                         std::CopyConstructible<Iterator>//, std::HasEqualTo<Iterator,Iterator>, std::HasNotEqualTo<Iterator,Iterator>
         {
-		//The iterator must have the same tag (e.g. vector_iterator_tag), otherwise operations on them wont make any sense!
+		//The iterators must have the same tag (e.g. vector_iterator_tag), otherwise operations on them wont make any sense!
                 typename tag=typename Iterator::tag;
                 typename otheriterator_tag=typename OtherIterator::tag;
                 requires std::SameType<tag,otheriterator_tag>;
@@ -35,22 +37,25 @@
                 //TODO: The sequence of the underlying iterators should be the same
                 //The sequence is not publically exposed though.
 
+		//advance_c<0> should work on all iterators.
                 //the computed types of the metafunctions should not exposed publically
                 //therefore the detail prefix
-		typename detail_next_type=typename result_of::next<Iterator>::type;
-		detail_next_type next(const Iterator&);
-
-		typename detail_advance_c_type=typename result_of::advance_c<Iterator,IntegralConstant>::type;
-		//detail_advance_c_type advance_c<IntegralConstant>(const Iterator&); is not valid in a concept!
-		detail_advance_c_type advance_c_test(const Iterator&,mpl::int_<IntegralConstant>);
+		typename detail_advance_c_type=typename result_of::advance_c<Iterator,0>::type;
+		//detail_advance_c_type advance_c<0>(const Iterator&); is not valid in a concept!
+		detail_advance_c_type advance_c_test(const Iterator&);
 
                 typename detail_distance_type=typename result_of::distance<Iterator,OtherIterator>::type;
                 //requires boost::mpl::concepts::Integral<detail_distance_type>;
                 detail_distance_type distance(const Iterator&,const OtherIterator&);
 
-		//These operations are only valid for non-end iterators. This concept should
-		//be valid for all iterator types, even the end ones, though. What to do?
-		//A different concept for non-end iterators?
+		//The following (meta-)functions are only valid for non-end iterators. Instantiating
+		//these functions with end-iterators might fail and therefore end-iterators could not be
+		//accepted by this concept.
+		//What to do? A different concept for non-end iterators?
+
+		//typename detail_next_type=typename result_of::next<Iterator>::type;
+		//detail_next_type next(const Iterator&);
+
                 //typename detail_deref_type=typename result_of::deref<Iterator>::type;
                 //detail_deref_type deref(const Iterator&);