Combine serveral ConvertibleTo - #2052
Draft
yhmtsai wants to merge 1 commit into
Draft
Conversation
MarcelKoch
reviewed
Jul 22, 2026
Comment on lines
+56
to
+57
| gko::detail::get_precision_list<ValueType, | ||
| gko::detail::precision_list>>, |
Member
There was a problem hiding this comment.
nit: I think the type could better be called conversion_types.
| void convert_to( | ||
| Coo<next_precision<ValueType>, IndexType>* result) const override; | ||
| template <typename ResultValueType> | ||
| void convert_to_impl(Coo<ResultValueType, IndexType>* result) const; |
Member
There was a problem hiding this comment.
I don't think we should have a *_impl function on the public interface. Either is should be renamed, or made private.
Member
Author
There was a problem hiding this comment.
yes, it should be in private although it will need all EnableConvertibleTo<*> to be friend of all class
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.
We have ConvertibleTo and usually for each precision we support.
Previously, we use the
next_precisionand macro condition to support them properly.Alternatively, we can merge them together and use template such that it inherit from all
ConvertibleTo<Class<Precision, Rest...>>Also, we can use mixin such that it use the template implementation automatically. (EnableConvertibleTo)
However, the mixin using the template member function does not implicit instantiate the function.
Some direction in my mind