mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
fix: a warning found by static code analyzer (#2783)
* Update attr.h: fix a warning found by static code analyzer Update attr.h: fix a warning found by Visual Studio static code analyzer Severity:Warning Code:C6323 Description: Use of arithmetic operator on Boolean type(s). Location: C:\src\onnxruntime\debug\pybind11\src\pybind11\include\pybind11\attr.h:547 * Update include/pybind11/attr.h Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> * Update attr.h Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
parent
f243450e89
commit
210c8c218f
@ -544,7 +544,7 @@ template <typename... Extra,
|
||||
size_t named = constexpr_sum(std::is_base_of<arg, Extra>::value...),
|
||||
size_t self = constexpr_sum(std::is_same<is_method, Extra>::value...)>
|
||||
constexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs) {
|
||||
return named == 0 || (self + named + has_args + has_kwargs) == nargs;
|
||||
return named == 0 || (self + named + size_t(has_args) + size_t(has_kwargs)) == nargs;
|
||||
}
|
||||
|
||||
PYBIND11_NAMESPACE_END(detail)
|
||||
|
Loading…
Reference in New Issue
Block a user