Created
November 25, 2009 19:43
-
-
Save mashiro/242974 to your computer and use it in GitHub Desktop.
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
#include <boost/unordered_map.hpp> | |
#include <map> | |
#include <list> | |
#include <typeinfo> | |
template <typename T> | |
class tree | |
{ | |
public: | |
typedef T value_type; | |
typedef tree<T> tree_type; | |
typedef std::list<T> trunk_type; | |
#if 1 | |
typedef boost::unordered_map<const std::type_info*, tree_type> branch_type; | |
#else | |
typedef std::map<const std::type_info*, tree_type> branch_type; | |
#endif | |
typedef typename trunk_type::iterator iterator; | |
typedef typename trunk_type::const_iterator const_iterator; | |
typedef typename branch_type::iterator branch_iterator; | |
typedef typename branch_type::const_iterator const_branch_iterator; | |
}; | |
int main() | |
{ | |
tree<int> t; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment