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

tree.h: Fix SetModelPresetVariant variant_index template parameter #600

Open
wants to merge 1 commit into
base: mainline
Choose a base branch
from

Conversation

davidgraeff
Copy link

Fixes compiling with -Werror=sign-conversion
Fixes #599

Fixes compiling with -Werror=sign-conversion
Fixes dmlc#599
@@ -428,7 +428,7 @@ class ModelPreset {

using ModelPresetVariant = std::variant<ModelPreset<float, float>, ModelPreset<double, double>>;

template <int variant_index>
template <std::size_t variant_index>
ModelPresetVariant SetModelPresetVariant(int target_variant_index) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ModelPresetVariant SetModelPresetVariant(int target_variant_index) {
ModelPresetVariant SetModelPresetVariant(std::size_t target_variant_index) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

The function argument should also be std::size_t.

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

Successfully merging this pull request may close these issues.

Incorrect type for SetModelPresetVariant
2 participants