URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-10-04 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Update doc of accus. Update Accumulator.
* mln/core/concept/accumulator.hh: Test if the convertion operator
exist.
* mln/core/concept/doc/accumulator.hh: Add operator result().
---
accumulator.hh | 3 +++
doc/accumulator.hh | 7 +++++++
2 files changed, 10 insertions(+)
Index: trunk/milena/mln/core/concept/doc/accumulator.hh
===================================================================
--- trunk/milena/mln/core/concept/doc/accumulator.hh (revision 1239)
+++ trunk/milena/mln/core/concept/doc/accumulator.hh (revision 1240)
@@ -44,6 +44,9 @@
/// The value type of elements to accumulate.
typedef void value;
+ /// The value type to return.
+ typedef void result_;
+
/// Initialize the accumulator.
void init();
@@ -52,6 +55,10 @@
/// Take into account another accumulator \p other.
void take(const E& other);
+
+ /// Convert the accumulator into the result.
+ operator result_() const;
+
};
} // end of namespace mln::doc
Index: trunk/milena/mln/core/concept/accumulator.hh
===================================================================
--- trunk/milena/mln/core/concept/accumulator.hh (revision 1239)
+++ trunk/milena/mln/core/concept/accumulator.hh (revision 1240)
@@ -71,6 +71,7 @@
void take(const value& v);
void take(const E& other);
result to_result() const;
+ operator result_() const;
*/
// Default impl.
@@ -99,6 +100,8 @@
m3 = 0;
result (E::*m4)() const = & E::to_result;
m4 = 0;
+ result (E::*m5)() const = & E::operator result;
+ m5 = 0;
}
template <typename E>