compute icon indicating copy to clipboard operation
compute copied to clipboard

Fixed nth_element, added unary_nor

Open koosha94 opened this issue 8 years ago • 1 comments

This commit adds unary_nor, and nor1 as a logical operator. It also adds/fixes support for user defined types in nth_element.

koosha94 avatar Mar 08 '16 03:03 koosha94

Thanks for that! It's a good idea, but I have some comments:

  • NOR is a binary operator (negation of OR).
  • NOR operator can be constructed just using binary_negate and logial_or:
not2(logical_or(arg1, arg2))
  • Don't use master branch for pull requests, make a special feature branch (in this case it could be called fix-nth-element' or whatever), because now yourmaster` and Boost.Compute are different and that can make problems when you want to make next pull request.
  • It would be great to have test for user-defined types for nth_element.

Maybe it would good to add find algorithm version that works with user defined types (Compare or Equal binary function would be required)?

jszuppe avatar Mar 08 '16 10:03 jszuppe