Skip to content
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

Add build step for NVCC and fix a warning #3227

Merged
merged 5 commits into from
Dec 30, 2021
Merged

Conversation

nlohmann
Copy link
Owner

@nlohmann nlohmann commented Dec 29, 2021

This PR adds a CI step for NVCC and fixes a warning reported in #2676.

@nlohmann nlohmann marked this pull request as draft December 29, 2021 14:37
@nlohmann nlohmann mentioned this pull request Dec 29, 2021
3 tasks
@coveralls
Copy link

coveralls commented Dec 29, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling cbd3034 on issue2676_nvcc_warnings into 29cd970 on develop.

@nlohmann nlohmann linked an issue Dec 29, 2021 that may be closed by this pull request
3 tasks
@nlohmann nlohmann self-assigned this Dec 29, 2021
@nlohmann nlohmann marked this pull request as ready for review December 29, 2021 20:20
@nlohmann nlohmann changed the title Add build step for NVCC Add build step for NVCC and fix a warning Dec 29, 2021
@nlohmann nlohmann added this to the Release 3.10.5 milestone Dec 29, 2021
Copy link
Contributor

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks a lot! 🎉

@nlohmann nlohmann merged commit 1aca6cb into develop Dec 30, 2021
@nlohmann nlohmann deleted the issue2676_nvcc_warnings branch December 30, 2021 12:40
@@ -664,6 +664,19 @@ class serializer
}
}

// templates to avoid warnings about useless casts
template <typename NumberType, enable_if_t<std::is_signed<NumberType>::value, int> = 0>
bool is_negative_number(NumberType x)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

template <typename NumberType>
enable_if_t<std::is_signed<NumberType>::value, bool> is_negative_number(NumberType x)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try this. You use legal but verbose and very indirect way for enable_if_t utilize.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a normal way to do it for functions that are already templates. https://en.cppreference.com/w/cpp/types/enable_if

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"legal but verbose", Ok
And how about this?

template < typename BasicJsonType, typename Key, typename Value, typename Compare, typename Allocator,
typename = enable_if_t < !std::is_constructible <
typename BasicJsonType::string_t, Key >::value >>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why @theodelrieu used the longer form here compared to the rest of the file, perhaps there was a technical reason. If not, it would make sense to use the value form as in the rest of the file. c5e63fd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants