Created
January 25, 2018 05:04
-
-
Save fujii/fea40827887237053b537f48807a8963 to your computer and use it in GitHub Desktop.
MSVC template friend class issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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