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

Improve visitor #9

Closed
martinmoene opened this issue Aug 20, 2018 · 6 comments
Closed

Improve visitor #9

martinmoene opened this issue Aug 20, 2018 · 6 comments

Comments

@martinmoene
Copy link
Owner

martinmoene commented Aug 20, 2018

From PR #8, @flexferrum

Only one thing here stuns me here:
I see no way to implement std-conformance visitor for C++98/03. I mean explicit specification of visitor's return type for C++98/03 case. And I still can't decide what to do with it.

  • return type, C++98... if at all possible
  • multiple variant arguments, C++11...

variant visit, cppreference:

template <class Visitor, class... Variants>
constexpr /*see below*/ visit(Visitor&& vis, Variants&&... vars);
@flexferrum
Copy link
Contributor

I've got some thoughts, related to code generation. And here is one significant problem: there is (or I see?) no way to make uniform visit signature for C++98/03 and C++11 etc. In the first case you have to explicitly declare visitor return type. In the second case you can (somehow) calculate it from the visitor.

@martinmoene
Copy link
Owner Author

Above bullets should have conveyed the message a split between C++98 and C++11 is perhaps to be made.

That may not solve your acute problem, but would be merely the result of the attention being drawn to visit.

@flexferrum
Copy link
Contributor

I suppose I know how to implement all this stuff.

@martinmoene
Copy link
Owner Author

Show it off ;)

Still a week to come near a usable computer. Working from phone right now enabling merging good pull requests (GPRS ;)

@flexferrum
Copy link
Contributor

flexferrum commented Aug 22, 2018

Show it off ;)

No problem. :) That's the prototype of implementation. It's needed to be checked, generalized and so on. But before I need the review regarding to coding style, naming etc. you take care of. Also I'm considering about perfect forwarding here and more test cases.

flexferrum@e877e59

@martinmoene
Copy link
Owner Author

Implemented per PR #11, continued in issue #12

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

No branches or pull requests

2 participants