
--- milena/ChangeLog | 7 +++++++ milena/mln/fun/v2b/{lnot.hh => always_false.hh} | 23 ++++++++++++----------- milena/mln/fun/v2b/{lnot.hh => always_true.hh} | 23 ++++++++++++----------- 3 files changed, 31 insertions(+), 22 deletions(-) copy milena/mln/fun/v2b/{lnot.hh => always_false.hh} (80%) mode change 100644 => 100755 copy milena/mln/fun/v2b/{lnot.hh => always_true.hh} (80%) mode change 100644 => 100755 diff --git a/milena/ChangeLog b/milena/ChangeLog index 116e287..1b7691e 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,10 @@ +2013-03-27 Guillaume Lazzara <z@lrde.epita.fr> + + Add constant Boolean functions. + + * mln/fun/v2b/always_false.hh, + * mln/fun/v2b/always_true.hh: New. + 2013-03-05 Roland Levillain <roland@lrde.epita.fr> Remove morpho::meyer_wst. diff --git a/milena/mln/fun/v2b/lnot.hh b/milena/mln/fun/v2b/always_false.hh old mode 100644 new mode 100755 similarity index 80% copy from milena/mln/fun/v2b/lnot.hh copy to milena/mln/fun/v2b/always_false.hh index 73d9ecf..96f843c --- a/milena/mln/fun/v2b/lnot.hh +++ b/milena/mln/fun/v2b/always_false.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -23,8 +23,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_V2B_LNOT_HH -# define MLN_FUN_V2B_LNOT_HH +#ifndef MLN_FUN_V2V_ALWAYS_FALSE_HH +# define MLN_FUN_V2V_ALWAYS_FALSE_HH /// \file /// @@ -44,21 +44,22 @@ namespace mln /// Functor computing logical-not on a value. template <typename V> - struct lnot : public Function_v2b< lnot<V> > + struct always_false : public Function_v2b< always_false<V> > { - typedef V result; - V operator()(const V& v) const; + typedef bool result; + typedef V argument; + + bool operator()(const V&) const; }; # ifndef MLN_INCLUDE_ONLY template <typename V> - inline - V - lnot<V>::operator()(const V& v) const + bool + always_false<V>::operator()(const V&) const { - return ! v; + return false; } # endif // ! MLN_INCLUDE_ONLY @@ -70,4 +71,4 @@ namespace mln } // end of namespace mln -#endif // ! MLN_FUN_V2B_LNOT_HH +#endif // ! MLN_FUN_V2V_ALWAYS_FALSE_HH diff --git a/milena/mln/fun/v2b/lnot.hh b/milena/mln/fun/v2b/always_true.hh old mode 100644 new mode 100755 similarity index 80% copy from milena/mln/fun/v2b/lnot.hh copy to milena/mln/fun/v2b/always_true.hh index 73d9ecf..4226422 --- a/milena/mln/fun/v2b/lnot.hh +++ b/milena/mln/fun/v2b/always_true.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -23,8 +23,8 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#ifndef MLN_FUN_V2B_LNOT_HH -# define MLN_FUN_V2B_LNOT_HH +#ifndef MLN_FUN_V2V_ALWAYS_TRUE_HH +# define MLN_FUN_V2V_ALWAYS_TRUE_HH /// \file /// @@ -44,21 +44,22 @@ namespace mln /// Functor computing logical-not on a value. template <typename V> - struct lnot : public Function_v2b< lnot<V> > + struct always_true : public Function_v2b< always_true<V> > { - typedef V result; - V operator()(const V& v) const; + typedef bool result; + typedef V argument; + + bool operator()(const V&) const; }; # ifndef MLN_INCLUDE_ONLY template <typename V> - inline - V - lnot<V>::operator()(const V& v) const + bool + always_true<V>::operator()(const V&) const { - return ! v; + return true; } # endif // ! MLN_INCLUDE_ONLY @@ -70,4 +71,4 @@ namespace mln } // end of namespace mln -#endif // ! MLN_FUN_V2B_LNOT_HH +#endif // ! MLN_FUN_V2V_ALWAYS_TRUE_HH -- 1.7.2.5