-
-
Save redpist/3732389 to your computer and use it in GitHub Desktop.
Example C++ML 2
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
#ifndef _2_H_ | |
#define _2_H_ | |
#include <iostream> | |
struct Abidbul { }; | |
template <int i> | |
struct NumType { }; | |
template <template <class, class> class Temp> | |
struct OLol { }; | |
template <typename T0, typename T1> // Americaine<int, double> | |
struct Americaine; | |
template <typename T0> | |
struct Americaine<T0, Abidbul> // Americaine<int, Abidbul> | |
{ | |
void MondeDeMerde() | |
{ | |
std::cout << "Americaine<int, Abidbul>" << std::endl; | |
} | |
}; | |
template <int i> | |
struct Americaine<NumType<i>, Abidbul> // Americaine<NumType<42>, Abidbul> | |
{ | |
void MondeDeMerde() | |
{ | |
std::cout << "Americaine<NumType<42>, Abidbul>" << std::endl; | |
} | |
}; | |
template <template <template <class, class> class> class Lol> | |
struct Americaine<Lol<Americaine>, Abidbul> // Americaine<OLol<Americaine>, Abidbul> | |
{ | |
void MondeDeMerde() | |
{ | |
std::cout << "Americaine<OLol<Americaine>, Abidbul>" << std::endl; | |
} | |
}; | |
template <typename T0, typename T1> // Americaine<int, double> | |
struct Americaine | |
{ | |
void MondeDeMerde() | |
{ | |
std::cout << "Americaine<int, double>" << std::endl; | |
} | |
}; | |
#endif /* _2_H_ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment