Skip to content

Instantly share code, notes, and snippets.

@fujii
Created January 25, 2018 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujii/fea40827887237053b537f48807a8963 to your computer and use it in GitHub Desktop.
Save fujii/fea40827887237053b537f48807a8963 to your computer and use it in GitHub Desktop.
MSVC template friend class issue
namespace WTF {
template<typename T> class NeverDestroyed {
public:
NeverDestroyed() {
new T;
}
};
}
using WTF::NeverDestroyed;
class NetworkProcess {
friend class NeverDestroyed<NetworkProcess>;
NetworkProcess();
public:
void test();
};
void NetworkProcess::test()
{
NeverDestroyed<NetworkProcess> networkProcess;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment