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

When use the std::string_view don't std::move the std::string. #BUG #78

Closed
Invincibl-e opened this issue Jan 12, 2019 · 1 comment
Closed

Comments

@Invincibl-e
Copy link

I find the bug form class Template:

  Template& operator=(Template&& oth) {
    bytecodes = std::move(oth.bytecodes);
    content = std::move(oth.content);
    return *this;
  }

the

struct Bytecode {
...
  std::string_view str;
...
}

str references Template::content, when move the Template::content, Template::content will be changed, the Bytecode::str is invalid.

You can reference basic_string_view#Notes

@pantor
Copy link
Owner

pantor commented Jan 13, 2019

You're right, but this is fixed in master. I will release an updated version as soon as possible.

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