This file contains hidden or 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
/** | |
* Sneaky public cast, implemented using the auto-return type friend | |
* function trick to have a stateful compiler. This links the value | |
* of a private pointer-to-member to a class. This code even works | |
* at compile-time. Although in Visual Studio, Intellisense seems | |
* to have trouble some trouble. | |
* | |
* Do note that you cannot use this public_cast function for a specific | |
* member above the `template<> link` specialization. This is because | |
* we're relying on compiler state, and it reads the file top-down. |