separate make pair

This commit is contained in:
hugogogo
2022-07-01 11:56:23 +02:00
parent ae646ee58a
commit 6e230109db
10 changed files with 104 additions and 1119 deletions

View File

@@ -26,13 +26,16 @@ PR_TPL
* copliens :
************/
PR_TPL PR::
pair() {
}
pair() {}
PR_TPL template< typename U, typename V > PR::
pair(const pair<U,V>& pr) : first(pr.first), second(pr.second) {
pair(const pair<U,V>& pr)
: first(pr.first)
, second(pr.second) {
}
PR_TPL PR::
pair(const first_type& a, const second_type& b) : first(a), second(b) {
pair(const first_type& a, const second_type& b)
: first(a)
, second(b) {
}
@@ -48,8 +51,7 @@ PR_TPL
PR_TPL
bool operator<(const PR& lhs, const PR& rhs) {
return (
lhs.first < rhs.first
return (lhs.first < rhs.first
|| ( !(rhs.first < lhs.first) && (lhs.second < rhs.second) )
);
}
@@ -74,11 +76,6 @@ PR_TPL
return !(lhs < rhs);
}
PR_TPL
PR make_pair(T1 x, T2 y) {
return PR(x, y) ;
}
} // namespace ft