I'd like to know if this code is valid or has an undefined behaviour, because my MSVC gives a warning C4355 this used in base member initializer list
.
struct S
{
string s_1;
string s_2;
S(string&& s_1, const string& s_2)
: s_1{ std::move(s_1) },
s_2{ s_2 + this->s_1 }
{
}
};
Is it allowed to use this
pointer in this case? Compiled with MSVC with a flag /std:c++17.