panthema / 2006 / SDIOS06 / sdios06 / include / libstdc++ / algorithm (Download File)
#ifndef ALGORITHM_
#define ALGORITHM_

namespace std {

	template<typename T>
	T min(T v1, T v2)
	{
		if(v1 < v2)
			return v1;
		return v2;
	}
	
	template<typename T>
	T max(T v1, T v2)
	{
		if(v2 < v1)
			return v1;
		return v2;
	}
	
	template<typename T>
	void swap(T& v1, T& v2)
	{
		T t(v1);
		v1 = v2;
		v2 = t;
	}

	template<typename Iter, typename Val>
	Iter find(Iter first, Iter last, const Val& val)
	{
		Iter i = first;
		
		while(i != last) {
			if(*i == val)
				break;
			++i;
		}

		return i;
	}

}

#endif
RSS 2.0 Weblog Feed Atom 1.0 Weblog Feed Valid XHTML 1.1 Valid CSS (2.1)
Copyright 2005-2014 Timo Bingmann - Impressum