ready for surrender
This commit is contained in:
@@ -6,34 +6,15 @@ namespace ft {
|
||||
|
||||
template <class InputIt1, class InputIt2>
|
||||
bool lexicographical_compare
|
||||
( InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) {
|
||||
( InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2 ) {
|
||||
|
||||
while (first1 != last1)
|
||||
{
|
||||
if (first2 == last2 || *first2 < *first1)
|
||||
return false;
|
||||
else if (*first1 < *first2)
|
||||
for (; first1 != last1; first1++, first2++) {
|
||||
if (*first1 < *first2)
|
||||
return true;
|
||||
++first1;
|
||||
++first2;
|
||||
}
|
||||
return (first2 != last2);
|
||||
}
|
||||
|
||||
template <class InputIt1, class InputIt2, class Compare>
|
||||
bool lexicographical_compare
|
||||
( InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp) {
|
||||
|
||||
while (first1 != last1)
|
||||
{
|
||||
if (first2 == last2 || comp(*first2, *first1))
|
||||
if (*first2 < *first1)
|
||||
return false;
|
||||
else if (comp(*first1, *first2))
|
||||
return true;
|
||||
++first1;
|
||||
++first2;
|
||||
}
|
||||
return (first2 != last2);
|
||||
return (first1 == last1 && first2 != last2);
|
||||
}
|
||||
|
||||
} // namespace ft
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace ft {
|
||||
template <
|
||||
typename T,
|
||||
typename Container = ft::vector<T>
|
||||
> class stack
|
||||
{
|
||||
> class stack {
|
||||
|
||||
public:
|
||||
typedef Container container_type;
|
||||
typedef typename Container::value_type value_type;
|
||||
@@ -22,7 +22,6 @@ public:
|
||||
************/
|
||||
// constructors ------------------------------
|
||||
explicit stack(const container_type& cont = Container()) : c(cont) {}
|
||||
explicit stack(stack const &other): c(other.c) {}
|
||||
|
||||
|
||||
/**********************
|
||||
@@ -55,7 +54,7 @@ public:
|
||||
friend bool operator>=(const stack<T2,C2>& lhs, const stack<T2,C2>& rhs);
|
||||
|
||||
protected:
|
||||
Container c;
|
||||
container_type c;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user