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
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| using namespace std; | |
| string toUpper(string str); | |
| string toLower(string str); | |
| vector<string> toUpper(vector<string> strings); | |
| vector<string> toLower(vector<string> strings); |
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
| #include <iostream> | |
| #include <vector> | |
| #include <stdexcept> | |
| #define varName(_variable_) #_variable_ | |
| using namespace std; | |
| int main(int argc, char *argv[]) { | |
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
| #include <iostream> | |
| #include <stdexcept> | |
| #include <string> | |
| using namespace std; | |
| int main() { | |
| constexpr uint16_t maxAge = 100; | |
| bool isInvalid; |
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
| #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| auto operator "" _x2(unsigned long long number) { | |
| return number * 2; | |
| } | |
| string operator "" _upper(char const * str, size_t size) { |
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
| #include <iostream> | |
| #include <map> | |
| #include <vector> | |
| using namespace std; | |
| void setupSwitchWithStrings(vector<string> strings, string& value, map<string,uint16_t>& map); | |
| void toLower(string& str); | |
| int main() { |
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
| #include <iostream> | |
| using namespace std; | |
| struct Box { | |
| static int objectCount; | |
| static constexpr int test = 20; | |
| Box() { |
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
| #include <iostream> | |
| #include <cassert> | |
| using namespace std; | |
| int main(int argc, char *argv[]) { | |
| uint16_t number1 = 10, number2 = 20; | |
| assert(number1 + number2 == 30); | |
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
| #include <iostream> | |
| using namespace std; | |
| int main(int argc, char *argv[]) { | |
| boolalpha(cout); | |
| bool isBig = false; | |
| bool hasGF = true; |
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
| #include <iostream> | |
| #define xAssert(_condition, _message) if (bool(_condition) == false) { \ | |
| cerr << "Condition: " << (#_condition)<< "\nError: " << (_message) << endl; exit(1); } | |
| using namespace std; | |
| int main(int argc, char *argv[]) { | |
| xAssert(1 + 2 == 2, "wrong result"); |
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
| #include <iostream> | |
| using namespace std; | |
| // Guard function | |
| template <typename Condition, typename Function> | |
| bool guard(const Condition& condition, Function function) { | |
| if (bool(!condition)) { | |
| function(); |