Closed
Conversation
igaztanaga
added a commit
that referenced
this pull request
Feb 23, 2026
Member
|
Thanks, it looks like a warning is triggered in MSVC 14.5 (C4180), so I tweaked a bit your patch and merge it to develop. Many thanks, it certainly simplifies a lot code and eases maintenance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Upon further inspection i've noticed that implementation of
ebo_function_holderis extremely redundant. This class template has essentially two flavors:Tis a class type, inheriting from it, hopefully utilizing Empty Base OptimizationTis a pointer to function type, storing pointer as a fieldCurrently a fancy
is_unary_or_binary_functiontrait is used to distinguish between these flavors, even though code only really cares whether it can inherit fromTor not.I've changed
ebo_function_holderto specialize forT *instead. This allowed toebo_function_holderwhich was used to store trait evaluation resultis_unary_or_binary_functionandis_unary_or_binary_function_implclasses since they were otherwise unusedAdditionally i've removed
t_is a pointer to function, initialization: t_(::boost::forward<Arg1>(arg1), ::boost::forward<Arg2>(arg2))couldn't possibly be valid. Presumably it was a result of copypasta.ebo_function_holder.hppI believe these changes preserve backward compatibility, except for cases when library users directly wrote
detail::is_unary_or_binary_functionin their code which they probably shouldn't have since it was not a part of public API.