/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __IWEAR_TRIPLE_H
#define __IWEAR_TRIPLE_H

namespace iwear
{

template<class T1, class T2, class T3>
struct triple
{
    typedef T1 first_type;
    typedef T2 second_type;
    typedef T3 third_type;

    T1 first;
    T2 second;
    T3 third;

    triple() : first(T1()), second(T2()), third(T3()) {}
    triple( const T1& t1, const T2& t2, const T3& t3 ) :
	first(t1), second(t2), third(t3) { }

    template<class U1, class U2, class U3>
    triple( const triple<U1,U2,U3>& p ) : 
	first(p.first), second(p.second), third(p.third) { }

};

template<class T1, class T2, class T3>
inline triple<T1,T2,T3> make_triple( const T1& t1, const T2& t2, const T3& t3 )
{
    return triple<T1,T2,T3> (t1,t2,t3);
}

template<class T1, class T2, class T3>
inline bool operator==( const triple<T1,T2,T3>& a, const triple<T1,T2,T3>& b )
{
    return a.first == b.first &&
		a.second == b.second &&
		a.third == b.third;
}

template<class T1, class T2, class T3>
inline bool operator!=( const triple<T1,T2,T3>& a, const triple<T1,T2,T3>& b )
{
    return !(a == b);
}

}

#endif
