Closed Bbllaaddee closed 3 years ago
The return type of a<b
is not a scalar but rather a non-evaluated tensor expression (BinaryCmpOp
). Making Fastor tensors work with C++ iterators would require a good amount of work.
This certainly needs to be fixed. I will see what I can do. Thanks for reporting.
Yeah, std::sort()
might have been an overkill for the purpose of this example, probably just if(a<b) { /*do something*/ }
is simpler.
Thank you!)
For your simpler case you can use any_of
, all_of
or none_of
based on your need. if (any_of(a<b)) /* do something*/
.
Hey there!
I am wondering about return type of comparison operator for two Fastor objects and its ability to be converted to
bool
.Here are two little programs:
This one outputs 1 and two (!) newline characters. In other words,
(a<b)
in output already has a newline character (which is a little strange, I suppose).May be that's a reason this expression cannot be implicitly (or explicitly, if you try to) converted to
bool
type, and the following program doesn't compile:So, I wanted to address this in this issue. Should it probably be fixed, or there's a specific idea behind it?
Cheers)