|
Boost Users : |
Subject: [Boost-users] question about fusion concepts/documentation
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-05-29 18:05:04
I'm working on a personal project based on fusion. This project builds a
library on
I'm working on an experimental library which builds on fusion. As part of
that
I want to implement concept checking for this experimental library. Since
this builds on fusion, I want to implement concept checking for fusion
so my library can build on that. Since fusion seems clearly documented, I
would
hope that this would be a fairly straight forward exercise.
This will also give me a better feel for concept checking and archtypes.
Looking at fusion documentation on page:
..libs/fusion/doc/html/fusion/iterator/concepts/forward_iterator.html
I find:
Expression Requirments
======================
next(i)
...
Meta Expressions
============
result_of::next<I>::type
...
Expression Semantics
===============
next(i) - An iterator to the element following i
...
So the quesion is: Why is result_of::next<I>::type necessary? The
expression symantics
only make sense if next(i) if it returns the same type as it's argument. So
why is the
result_of::next<I>::type needed at all. That is won't it always be equal to
I. If not,
why not?
The question I have applies to other functions as well but next illustrates
my question.
specifially I have the same question regarding advance, and advance_c.
Also the espressions i == j should return a value convertible to bool.
Then what
is result_of::equal_to<I, J>::type to be used for? distance raises similar
quesions.
I'm actually having quite a bit of difficulty with this task - the above
quesions are
only the easiest one to formulate.
Robert Ramey
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net