#180: algebra::vec's != operators cannot be used.
---------------------+------------------------------------------------------
Reporter: lazzara | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
---------------------+------------------------------------------------------
The following example does not compile.
test.cc:
{{{
# include <mln/algebra/vec.hh>
int main()
{
using namespace mln::algebra;
vec<3, float> a, b;
bool c = (a != b);
}
}}}
g++ -I. test.cc
{{{
test.cc: In function 'int main()':
test.cc:6: error: cannot convert 'mln::algebra::vec<3u, bool>' to
'bool'
in initialization
./mln/core/routine/ops.hh: In function 'typename mln::trait::op::neq<L,
R>::ret mln::operator!=(const mln::Object<E>&, const
mln::Object<O2>&)
[with O1 = mln::algebra::vec<3u, float>, O2 = mln::algebra::vec<3u,
float>]':
test.cc:6: instantiated from here
./mln/core/routine/ops.hh:528: error: conversion from 'bool' to non-scalar
type 'mln::algebra::vec<3u, bool>' requested
}}}
Note that if '(a != b)' is replaced by '(a == b)' or '!(a == b)',
this
example compiles.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/180>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.