/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include <utility>

namespace glm
{
	/**
	* \brief Make an ordered pair from two values of a given type.
	*
	* OrderableType The type of the values, must define <.
	* \param[in] value1 The first value.
	* \param[in] value2 The second value.
	* \return A pair containing the two values where the first element is the minimum of the two.
	* \ingroup containers
	* \author Golaem <dev@golaem.com>
	*/
	template<class OrderableType>
	std::pair<OrderableType,OrderableType> makeOrderedPair(const OrderableType & value1, const OrderableType & value2)
	{
		if (value2 < value1)
		{
			return std::make_pair(value2,value1);
		}
		else
		{
			return std::make_pair(value1,value2);
		}
	}
}
