-
Notifications
You must be signed in to change notification settings - Fork 20
TDeque to std::deque #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
TDeque to std::deque #133
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
#include <string> | ||
#include <utility> | ||
#include <deque> | ||
|
||
template <class T> | ||
struct TDumper { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
#include <memory> | ||
#include <initializer_list> | ||
|
||
template <class T, class A> | ||
/*template <class T, class A> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Если кроме деки тут ничего не осталось, нужно удалить файл |
||
class TDeque: public std::deque<T, TReboundAllocator<A, T>> { | ||
using TBase = std::deque<T, TReboundAllocator<A, T>>; | ||
|
||
|
@@ -22,4 +22,4 @@ class TDeque: public std::deque<T, TReboundAllocator<A, T>> { | |
inline explicit operator bool() const noexcept { | ||
return !this->empty(); | ||
} | ||
}; | ||
};*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ class TDequeTest: public TTestBase { | |
UNIT_TEST_SUITE_REGISTRATION(TDequeTest); | ||
|
||
void TDequeTest::TestConstructorsAndAssignments() { | ||
using container = TDeque<int>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Тесты для STL деки не нужны |
||
using container = std::deque<int>; | ||
|
||
container c1; | ||
c1.push_back(100); | ||
|
@@ -66,7 +66,7 @@ void TDequeTest::TestConstructorsAndAssignments() { | |
} | ||
|
||
void TDequeTest::TestDeque1() { | ||
TDeque<int> d; | ||
std::deque<int> d; | ||
UNIT_ASSERT(!d); | ||
|
||
d.push_back(4); | ||
|
@@ -89,8 +89,8 @@ void TDequeTest::TestDeque1() { | |
UNIT_ASSERT(d[2] == 25); | ||
|
||
//Some compile time tests: | ||
TDeque<int>::iterator dit = d.begin(); | ||
TDeque<int>::const_iterator cdit(d.begin()); | ||
std::deque<int>::iterator dit = d.begin(); | ||
std::deque<int>::const_iterator cdit(d.begin()); | ||
|
||
UNIT_ASSERT((dit - cdit) == 0); | ||
UNIT_ASSERT((cdit - dit) == 0); | ||
|
@@ -100,14 +100,14 @@ void TDequeTest::TestDeque1() { | |
} | ||
|
||
void TDequeTest::TestInsert() { | ||
TDeque<int> d; | ||
std::deque<int> d; | ||
d.push_back(0); | ||
d.push_back(1); | ||
d.push_back(2); | ||
|
||
UNIT_ASSERT(d.size() == 3); | ||
|
||
TDeque<int>::iterator dit; | ||
std::deque<int>::iterator dit; | ||
|
||
//Insertion before begin: | ||
dit = d.insert(d.begin(), 3); | ||
|
@@ -177,8 +177,8 @@ void TDequeTest::TestInsert() { | |
} | ||
|
||
void TDequeTest::TestAt() { | ||
TDeque<int> d; | ||
TDeque<int> const& cd = d; | ||
std::deque<int> d; | ||
std::deque<int> const& cd = d; | ||
|
||
d.push_back(10); | ||
UNIT_ASSERT(d.at(0) == 10); | ||
|
@@ -189,12 +189,12 @@ void TDequeTest::TestAt() { | |
|
||
void TDequeTest::TestAutoRef() { | ||
int i; | ||
TDeque<int> ref; | ||
std::deque<int> ref; | ||
for (i = 0; i < 5; ++i) { | ||
ref.push_back(i); | ||
} | ||
|
||
TDeque<TDeque<int>> d_d_int(1, ref); | ||
std::deque<std::deque<int>> d_d_int(1, ref); | ||
d_d_int.push_back(d_d_int[0]); | ||
d_d_int.push_back(ref); | ||
d_d_int.push_back(d_d_int[0]); | ||
|
@@ -207,7 +207,7 @@ void TDequeTest::TestAutoRef() { | |
} | ||
|
||
void TDequeTest::TestErase() { | ||
TDeque<int> dint; | ||
std::deque<int> dint; | ||
dint.push_back(3); | ||
dint.push_front(2); | ||
dint.push_back(4); | ||
|
@@ -216,7 +216,7 @@ void TDequeTest::TestErase() { | |
dint.push_front(0); | ||
dint.push_back(6); | ||
|
||
TDeque<int>::iterator it(dint.begin() + 1); | ||
std::deque<int>::iterator it(dint.begin() + 1); | ||
UNIT_ASSERT(*it == 1); | ||
|
||
dint.erase(dint.begin()); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пробел лишний