--- milena/ChangeLog | 5 +++++ milena/mln/core/concept/function.hh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog index 8014d4b..839b808 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,8 @@ +2011-09-13 Guillaume Lazzara z@lrde.epita.fr + + * mln/core/concept/function.hh: Be consistent in operator=() + prototype. + 2011-09-13 Roland Levillain roland@lrde.epita.fr
Prevent g++ 4.2 from issuing bad code for constrained-connectivity. diff --git a/milena/mln/core/concept/function.hh b/milena/mln/core/concept/function.hh index 5b6c15a..22e338e 100644 --- a/milena/mln/core/concept/function.hh +++ b/milena/mln/core/concept/function.hh @@ -76,7 +76,7 @@ namespace mln
Apple's llvm-gcc has a bug causing memmove() errors if the copy constructor is not declared along with operator=(). */ - Function& operator=(const Function&); + Function<E>& operator=(const Function<E>&); };
@@ -231,7 +231,7 @@ namespace mln template <typename E> inline Function<E>& - Function<E>::operator=(const Function&) + Function<E>::operator=(const Function<E>&) { return *this; }
Le 13 sept. 2011 à 14:42, Guillaume Lazzara a écrit :
[...]
diff --git a/milena/mln/core/concept/function.hh b/milena/mln/core/concept/function.hh index 5b6c15a..22e338e 100644 --- a/milena/mln/core/concept/function.hh +++ b/milena/mln/core/concept/function.hh @@ -76,7 +76,7 @@ namespace mln
Apple's llvm-gcc has a bug causing memmove() errors if the copy constructor is not declared along with operator=(). */
- Function& operator=(const Function&);
- Function<E>& operator=(const Function<E>&); };
Actually, you should have updated ctors as well if you wanted to be truly ``consistent''. And more: other classes of this file as well! :-)
The parameter list is not required within the declaration of a template class, and the declaration of Function<E> was perfectly valid before your change. Given this, plus the fact that changing other names is time-consuming and painful, I suggest we use non-parameterized names within class declarations (and in the present case, revert this very change).
@@ -231,7 +231,7 @@ namespace mln template <typename E> inline Function<E>&
- Function<E>::operator=(const Function&)
- Function<E>::operator=(const Function<E>&) { return *this; }
On the other hand, that change on the *definition* of operator= makes more sense (even if the parameter is optional for the argument type), so I think we can keep it.