separate make pair
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user