Click here to Skip to main content
15,885,435 members
Articles / Desktop Programming / MFC

Tree Container Library

Rate me:
Please Sign up or sign in to vote.
4.85/5 (29 votes)
22 Aug 2007Zlib10 min read 228.3K   7.2K   111  
A generic template class library for storing data in a tree-like structure.
#pragma once
#include "basic_tree_tester.h"

struct alt_order
{
	bool operator()(const Alpha& lhs, const Alpha& rhs)
	{
		return rhs.get_text() < lhs.get_text();
	}
};

class unique_tree_tester : public basic_tree_tester<unique_tree<Alpha, std::less<Alpha>, alt_order > >
{
public:
	unique_tree_tester() {}
	~unique_tree_tester() {}

	void run();

private:
	void test_erase_stored_type();
	void test_find_deep();
	void test_ordered_iterators();
	void test_allow_orphans();
	void test_find_ordered();
	void test_ordered_begin_end();
	void test_insert_parent_child();
	void test_is_orphan();
};


void test_unique_tree();

#include "unique_tree_tester.inl"

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The zlib/libpng License



Comments and Discussions