generated from cpp-best-practices/cmake_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NOTE: I did this manually, but most of this could have been done with clang-tidy modernize checks. I did it manually largely to talk through the WHY * Use `noexcept` where appropriate * `constexpr` All The Things (That C++11 allows) * Move to `enum struct` * Rename .h files .hpp because they are not intended for consumption by C, only by C++ * use `std::array` where appropriate * use move / forward where appropriate * use `auto` where appropriate
- Loading branch information
Showing
12 changed files
with
165 additions
and
190 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
#ifndef INFIZ_EVALUATOR_HPP | ||
#define INFIZ_EVALUATOR_HPP | ||
|
||
#include "RationalNumber.h" | ||
#include "Stack.h" | ||
#include "StringTokenizer.h" | ||
#include "RationalNumber.hpp" | ||
#include "Stack.hpp" | ||
#include "StringTokenizer.hpp" | ||
|
||
enum Operators { PLUS_SIGN, CLOSE_PAREN, OPEN_PAREN, MINUS_SIGN, DIVIDE_SIGN, MULTIPLY_SIGN }; | ||
enum struct Operators { PLUS_SIGN, CLOSE_PAREN, OPEN_PAREN, MINUS_SIGN, DIVIDE_SIGN, MULTIPLY_SIGN }; | ||
|
||
|
||
int precedence(Operators input); | ||
RationalNumber evaluateExpression(StringTokenizer &tokenizer); | ||
void evaluateStacks(Stack<RationalNumber> &numbers, Stack<int> &operators); | ||
void evaluateStacks(Stack<RationalNumber> &numbers, Stack<Operators> &operators); | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.