fix: correct types so it compiles on later C++ versions #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
plugin_vc (and other plugins, probably) failed to compile on /std:c++latest on my system because of these errors:
This PR attempts to solve that. In
Pattern.h
's case,..\hooking\Hooking.Patterns.h
has:which calls:
and auto is deduced as
basic_pattern<assert_err_policy>
which is not a reference.In SpriteLoader's case, in https://en.cppreference.com/w/cpp/language/auto it says that the type deduction for auto is ruled by the same rules as template argument deduction: https://en.cppreference.com/w/cpp/language/template_argument_deduction. C++ has a feature to extend the lifetime of an object if it's bound to a
const auto&
, thus it works for both lvalues and rvalues (temporary variables). Even if you could do something likeauto&&
, we're not changings
, thus it's a perfectly sensible choice.Edit: seems like Github is confused about the commit author, ignore that aspect.