Created
July 11, 2019 10:26
-
-
Save AtnNn/f5e38e60becef30fae2d574b4256fa8d to your computer and use it in GitHub Desktop.
Blog idea!
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
#include <string> | |
template <auto Name> | |
struct Int { private: int n; }; | |
struct EI : Int<1>, virtual Int<2> {}; | |
struct DI : virtual Int<2> {}; | |
struct FI : EI, DI {}; | |
struct DC { int a1; int a2; }; | |
struct EC { int a2; }; | |
struct FC : EC, DC {}; | |
int main() { | |
FI x; | |
(Int<2>)x; // Ok! | |
FC y; | |
y.a2; // Error! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment