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

add rvalue reference support for static_variant #155

Merged
merged 2 commits into from
Apr 3, 2020

Conversation

huangminghuang
Copy link
Contributor

This PR allows one to use static_variant as rvalue reference with visitor as follows:

  static_variant<string, vector<char>> value =...;
  std::move(value).visit( overloaded {
    [](string&& v) { ...},
    [](vector<char>&& v) {...}
  } };

@huangminghuang huangminghuang requested a review from heifner April 1, 2020 13:11
Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a tests for this to test_static_variant.cpp

@huangminghuang huangminghuang requested a review from heifner April 1, 2020 16:24
@huangminghuang huangminghuang merged commit dae9acc into master Apr 3, 2020
@huangminghuang huangminghuang deleted the static_variant-rvalue-reference branch April 3, 2020 17:17
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

Successfully merging this pull request may close these issues.

3 participants