0

As I saw on cppcoreguidelines page, http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Ru-anonymous

there is a statement like this

void Value::set_text(const string& ss)
{
    if (type == Tag::text)
        s = ss;
    else {
        new(&s) string{ss};   // s is a member string of class Value
        type = Tag::text;
    }
}

I have never seen such usage before. What does this mean?

RainMan14
  • 105
  • 1
  • 9

0 Answers0