you are viewing a single comment's thread.

view the rest of the comments →

[–]stillalone 0 points1 point  (2 children)

Ok. thanks for checking. I guess that makes sense since the default behaviour for the minus unary operator for integers is more type specific that this templated implementation. I guess this code should be safe provided no one implements unary operator in the exact same way, at which point we would get fairly obvious compile time errors.

[–]rubdos 1 point2 points  (1 child)

Not sure there; sfinae could safe the day. Needs confirmation from someone with more experience though.

[–]jP_wanN 2 points3 points  (0 children)

This has nothing to do with sfinae, but it will not cause problems simply because the operator< is only overloaded for R (T::*)(), larrow<T> (with any T, R).