/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* pair.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/11/22 13:39:29 by apommier #+# #+# */ /* Updated: 2022/11/28 15:59:35 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once namespace ft { template struct pair{ typedef T1 first_type; typedef T2 second_type; first_type first; second_type 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= (const pair& pr) { if (this != &pr) { this->first = pr.first; this->second = pr.second; } return (*this); } ~pair() {} }; 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