-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max(a, b) template function error #23
Comments
Hello, Thank you for reporting this. You're not the first to notice this issue, it should be related to pull request #19. Unfortunately, the fix you suggest is not the right one. Max and min take only one template parameter for a reason, i.e. to suppress common type deduction behavior and ensure the returned type is exactly the same as the type of both arguments. Your fix instead makes max return the type of the first argument, which is not the desired behavior. As I noted in #19, the correct fix is to replace all constants like The issue is due to an oversight on my part, I chose a lazy approach and failed to notice that it wouldn't work on some platforms. Unfortunately I'm very busy and I haven't been able to find some time to fix this myself. I am ready to accept a pull request implementing the solution I suggested. I can't accept different solutions for the reason I explained above. Kind regards, |
By the way, I'm curious as to why you are compiling with clang 3.9. This is if I'm not wrong a very old version. If you are doing this just because it's the version specified in the README, please note that it was written long ago and I would now recommend more recent versions of the compiler. The library should be compliant with the ISO-C++14 standard, hence compatible with recent versions of clang. |
First off I'll have to say I'm not experienced with programming. |
Identical error in a few more places.
Fixed by adding this to utils:
Probably should do this to min() too.
clang++-3.9
-g -MMD -MP -std=c++14
The text was updated successfully, but these errors were encountered: