-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: simplify SFINAE of ToStringHelper::BaseConvert
#44306
Conversation
ToStringHelper::BaseConvert
ToStringHelper::BaseConvert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Landed in f36813c |
PR-URL: #44306 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #44306 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #44306 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: nodejs#44306 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
For some reason, this is not compiling in the v16.x branch. It may be related to a cpp version or something. esult -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++14 -MMD -MF /home/juanarbol/GitHub/node/out/Release/.deps//home/juanarbol/GitHub/node/out/Release/obj.target/libnode/src/module_wrap.o.d.raw -c
In file included from ../src/js_stream.cc:5:
In file included from ../src/node_errors.h:6:
../src/debug_utils-inl.h:32:46: error: no template named 'is_integral_v' in namespace 'std'; did you mean 'is_integral'?
typename = std::enable_if_t<std::is_integral_v<T>>>
~~~~~^~~~~~~~~~~~~
is_integral
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/type_traits:392:12: note: 'is_integral' declared here
struct is_integral
^
In file included from ../src/js_stream.cc:5:
In file included from ../src/node_errors.h:6:
../src/debug_utils-inl.h:32:41: error: template argument for non-type template parameter must be an expression
typename = std::enable_if_t<std::is_integral_v<T>>> And the complaints grow and grow. |
|
Simplify SFINAE of
ToStringHelper::BaseConvert
using technique from https://www.fluentcpp.com/2018/05/18/make-sfinae-pretty-2-hidden-beauty-sfinae/