leaf_class.h
Go to the documentation of this file.00001 #ifndef UTIL_LEAF_CLASS_H
00002 #define UTIL_LEAF_CLASS_H
00003
00004 #include <config.h>
00015 namespace template_utils
00016 {
00017 class this_class {};
00018
00019 template <class T, class Self>
00020 struct resolve_this
00021 {
00022 typedef T type;
00023 };
00024
00025 template<class Self>
00026 struct resolve_this<this_class,Self>
00027 {
00028 typedef Self type;
00029 };
00030
00031 #define RESOLVE_LEAF_CLASS(T,Self) typename template_utils::resolve_this<T,Self>::type
00032 };
00033
00034 #endif // UTIL_LEAF_CLASS_H
00035