https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Allow delayed construction of function expressions.
* mln/trait/ch_value.hh (mln_ch_value_): New.
* mln/pw/cst.hh (cst_): New ctor without arg.
* mln/fun/ops.hh (mln_decl_binary_expr_): New ctor wihtout arg
so that the definition of expr template functions involved in
image types can be delayed.
(mln_decl_unary_expr_): Likewise.
fun/ops.hh | 16 ++++++++++++----
pw/cst.hh | 10 +++++++++-
trait/ch_value.hh | 1 +
3 files changed, 22 insertions(+), 5 deletions(-)
Index: mln/trait/ch_value.hh
--- mln/trait/ch_value.hh (revision 2075)
+++ mln/trait/ch_value.hh (working copy)
@@ -38,6 +38,7 @@
# define mln_ch_value(I, V) typename mln::trait::ch_value< I, V >::ret
+# define mln_ch_value_(I, V) mln::trait::ch_value< I, V >::ret
Index: mln/pw/cst.hh
--- mln/pw/cst.hh (revision 2075)
+++ mln/pw/cst.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -50,6 +50,8 @@
{
typedef T result;
+ cst_();
+
cst_(const T& t);
template <typename P>
@@ -72,6 +74,12 @@
template <typename T>
inline
+ cst_<T>::cst_()
+ {
+ }
+
+ template <typename T>
+ inline
cst_<T>::cst_(const T& t)
: t_(t)
{
Index: mln/fun/ops.hh
--- mln/fun/ops.hh (revision 2075)
+++ mln/fun/ops.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -51,6 +51,10 @@
typedef typename mln::trait::op:: Name < mln_result(L), \
mln_result(R) >::ret result; \
\
+ Name##_##Out##_expr_() \
+ { \
+ } \
+ \
Name##_##Out##_expr_(const L& l, const R& r) \
: l_(l), r_(r) \
{ \
@@ -63,8 +67,8 @@
} \
\
protected: \
- const L l_; \
- const R r_; \
+ L l_; \
+ R r_; \
}; \
\
} \
@@ -103,6 +107,10 @@
{ \
typedef typename mln::trait::op:: Name < mln_result(F) >::ret result; \
\
+ Name##_##Out##_expr_() \
+ { \
+ } \
+ \
Name##_##Out##_expr_(const F& f) \
: f_(f) \
{ \
@@ -115,7 +123,7 @@
} \
\
protected: \
- const F f_; \
+ F f_; \
}; \
\
} \