/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* pair.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/11/22 13:39:29 by apommier #+# #+# */ /* Updated: 2022/11/24 17:38:32 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once namespace ft { template struct pair{ typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair(): first(), second() {} pair( const T1& x, const T2& y ) : first(x), second(y) {} template pair(const pair& p): first(p.first), second(p.second) { } pair& operator=(pair& other) { first = other.first; second = other.second; return (*this); } }; template bool operator== (const pair& lhs, const pair& rhs) { return (lhs.first == rhs.first && lhs.second == rhs.second); } template bool operator!= (const pair& lhs, const pair& rhs) { return (!(lhs == rhs)); } template bool operator< (const pair& lhs, const pair& rhs) { return (lhs.first < rhs.first || (!(rhs.first < lhs.first) && lhs.second < rhs.second)); } template bool operator<= (const pair& lhs, const pair& rhs) { return (!(rhs bool operator> (const pair& lhs, const pair& rhs) { return (rhs bool operator>= (const pair& lhs, const pair& rhs) { return (!(lhs