Skip to content

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

@Invincibl-e

Description

@Invincibl-e

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions