C++ VS when making template class a friend of any instantiation of itself gets this error "cannot access private member declared in class"

Matthew Heyn

New Member
Joined
Jun 2, 2020
If anyone else is having the same issues with Studio that I am having this seems to be the best workaround that I have found.

Avoid constexpr initialization of the 'kek' variable (by removing the 'constexpr' specifier on the variable and the 'constexpr' specifier from the Test::eek:perator+() function).
Compile in C++14 mode (guaranteed copy elision is enabled only in C++17 mode and later).
Alternatively, compile with the (undocumented and unpublished) /d1gce- option, which will disable guaranteed copy

Hope that helps.
 
Back
Top Bottom