[fix/docs]: remove memory leak in queue (#2417)

* fix: remove memory leak in queue

* updating DIRECTORY.md

* clang-format and clang-tidy fixes for effd74c9

* style: simplify logic while using reserve

* style: use value_type as return type in front

* style: use proper error message

* style: use pre-increment and pre-decrement

* docs: use doxygen syntax

* docs: improve wording

Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Piotr Idzik
2023-01-26 07:29:37 +01:00
committed by GitHub
parent 5b238724b8
commit 7c090481da
7 changed files with 250 additions and 161 deletions

View File

@@ -157,7 +157,7 @@ void testAssign() {
assert(stackB.toVector() == otherExpectedDataB);
}
void testTopThrowsAnvalidArgumentWhenStackEmpty() {
void testTopThrowsAnInvalidArgumentWhenStackEmpty() {
const stack<long double> curStack;
bool wasException = false;
try {
@@ -168,7 +168,7 @@ void testTopThrowsAnvalidArgumentWhenStackEmpty() {
assert(wasException);
}
void testPopThrowsAnvalidArgumentWhenStackEmpty() {
void testPopThrowsAnInvalidArgumentWhenStackEmpty() {
stack<bool> curStack;
bool wasException = false;
try {
@@ -195,8 +195,8 @@ int main() {
testAssign();
testTopThrowsAnvalidArgumentWhenStackEmpty();
testPopThrowsAnvalidArgumentWhenStackEmpty();
testTopThrowsAnInvalidArgumentWhenStackEmpty();
testPopThrowsAnInvalidArgumentWhenStackEmpty();
std::cout << "All tests pass!\n";
return 0;