meta::visit added in accordance to meta::for_each. (only c++17)#73
Open
gabyx wants to merge 4 commits intoericniebler:masterfrom
Open
meta::visit added in accordance to meta::for_each. (only c++17)#73gabyx wants to merge 4 commits intoericniebler:masterfrom
gabyx wants to merge 4 commits intoericniebler:masterfrom
Conversation
gabyx
commented
Feb 14, 2019
| { | ||
| template<typename Fn, typename Type> | ||
| struct visit{ | ||
| static constexpr void call(Fn f){ f(Type{}); } |
Author
There was a problem hiding this comment.
I had to use this struct dispatch to defer no to have void as Type instantiate
in FnPtr.
gabyx
commented
Feb 14, 2019
include/meta/meta.hpp
Outdated
|
|
||
| #if META_CXX_INLINE_VARIABLES | ||
| /// `visit(List, I, Fn)` calls the \p UnaryFunction for the \p i | ||
| /// -th argument in the \p List. No-opt if \p i not in range. |
Author
There was a problem hiding this comment.
I did not want to throw exception here -> no-op if not in range. Should we make that UB and leave the check to the user?
gabyx
commented
Feb 14, 2019
| #endif | ||
|
|
||
| #ifndef META_CXX_VISIT | ||
| #define META_CXX_VISIT (META_CXX_VER >= META_CXX_STD_17) |
Author
There was a problem hiding this comment.
I need full c++17 support -> constexpr everywhere...
a7a6d05 to
b39c151
Compare
Author
|
Rebased onto master. |
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.
This is my first shot. Maybe there are better solutions. I tried hard to stick to the current for_each implementation and use the same approach.
-> Tests/Doc added.