https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix some warnings with g++-4.3.
* mln/core/neighborhood.hh (window): Fix missing namespace.
* mln/core/concept/proxy.hxx: Use mlc_const_return when needed.
* mln/metal/const.hh (mlc_const_return): New macro.
(const_return_): New traits.
core/concept/proxy.hxx | 10 +++++-----
core/neighborhood.hh | 2 +-
metal/const.hh | 19 +++++++++++++++++++
3 files changed, 25 insertions(+), 6 deletions(-)
Index: mln/core/neighborhood.hh
--- mln/core/neighborhood.hh (revision 2192)
+++ mln/core/neighborhood.hh (working copy)
@@ -117,7 +117,7 @@
- typedef window<D> window;
+ typedef mln::window<D> window;
mln::window<D> to_window() const
{
Index: mln/core/concept/proxy.hxx
--- mln/core/concept/proxy.hxx (revision 2192)
+++ mln/core/concept/proxy.hxx (working copy)
@@ -58,7 +58,7 @@
struct helper_unprox_if< true, P >
{
typedef mlc_unqualif(mln_q_subject(P)) ret;
- static mlc_const(mln_q_subject(P)) on(const Proxy<P>& p);
+ static mlc_const_return(mln_q_subject(P)) on(const Proxy<P>& p);
};
template <typename P>
@@ -258,7 +258,7 @@
typedef Subject HOT_actual_subject;
HOT_actual_subject get_subject();
- mlc_const(HOT_actual_subject) get_subject() const;
+ mlc_const_return(HOT_actual_subject) get_subject() const;
};
template <typename Subject, typename E>
@@ -278,7 +278,7 @@
{
return mln::internal::force_exact<E>(*this).subj_();
}
- mlc_const(q_subject) unproxy_() const
+ mlc_const_return(q_subject) unproxy_() const
{
E& self_ = mln::internal::force_exact<E>(*this);
return self_.subj_();
@@ -295,7 +295,7 @@
template <typename P>
inline
- mlc_const(mln_q_subject(P))
+ mlc_const_return(mln_q_subject(P))
helper_unprox_if< true, P >::on(const Proxy<P>& p)
{
return exact(p).unproxy_();
@@ -367,7 +367,7 @@
template <typename Subject, typename E>
inline
- typename mln::metal::const_< typename helper_get_proxy_impl< Subject, E, false
>::HOT_actual_subject >::ret
+ typename mln::metal::const_return_< typename helper_get_proxy_impl< Subject, E,
false >::HOT_actual_subject >::ret
helper_get_proxy_impl< Subject, E, false >::get_subject() const
{
return unproxy_rec(mln::internal::force_exact<const E>(*this));
Index: mln/metal/const.hh
--- mln/metal/const.hh (revision 2192)
+++ mln/metal/const.hh (working copy)
@@ -37,6 +37,9 @@
# define mlc_const(T) typename mln::metal::const_< T >::ret
+# define mlc_const_return(T) typename mln::metal::const_return_< T >::ret
+
+
namespace mln
{
@@ -44,6 +47,8 @@
namespace metal
{
+ // const_
+
template <typename T> struct const_/* T */ { typedef const T ret;
};
template <typename T> struct const_< const T > { typedef const T
ret; };
@@ -55,6 +60,20 @@
template <typename T> struct const_< T* const > { typedef const T*
const ret; };
template <typename T> struct const_< const T* const > { typedef const T*
const ret; };
+
+ // const_return_
+
+ template <typename T> struct const_return_/* T */ { typedef T
ret; };
+ template <typename T> struct const_return_< const T > { typedef
T ret; };
+
+ template <typename T> struct const_return_< T& > {
typedef const T& ret; };
+ template <typename T> struct const_return_< const T& > {
typedef const T& ret; };
+
+ template <typename T> struct const_return_< T* > { typedef
const T* ret; };
+ template <typename T> struct const_return_< const T* > { typedef
const T* ret; };
+ template <typename T> struct const_return_< T* const > { typedef
const T* ret; };
+ template <typename T> struct const_return_< const T* const > { typedef
const T* ret; };
+
} // end of namespace mln::metal
} // end of namespace mln