Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Empty {};
- template <int H, class T = Empty>
- struct list {
- static const int head = H;
- typedef T tail;
- };
- template <class T,int N>
- struct min_elem{};
- template<int H, class T,int N>
- struct min_elem<list<H,T>,N >{
- static const int value = (N>H ? min_elem<T,H>::value : min_elem<T,N>::value );
- };
- template<int N>
- struct min_elem<Empty,N>{
- static const int value=N;
- };
- template <class T>
- struct min{};
- template <int I, class T>
- struct min<list<I,T> > {
- static const int value = min_elem<list<I,T>, I>::value;
- };
- template<class T, int K>
- struct re{};
- template<int I, class T, int K>
- struct re <list<I,T>,K>{
- typedef list< ?? don't know what should I exactly do here> value;
- };
- template<int I>
- struct re <Empty,I>{
- ??
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement