diff --git a/CMakeLists.txt b/CMakeLists.txt index 84a27fadfbcbcf7902c3ba54a019f103de3ce553..7386a5a775a373abc65aca67a7a7bd6ce515aecf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(stl_debug VERSION 0.1.0 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 17) +set(default_build_type "Debug") + INCLUDE_DIRECTORIES( include ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 802fad6ca111135e508c1daf2e15e660d9483cae..722da0930f6369e8ca428ce8099f3a116d5a551c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable( - stl_test main.cpp Human.cpp Student.cpp logging.cpp + lab0_debug main.cpp Human.cpp Student.cpp logging.cpp ) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 898c43825320b3c5267cccc32e5027a2bdd7df0a..14e5a6ccbfb882b82a0c39713501f3ba707cf679 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,5 @@ +#include +#include #include #include "Human.hpp" #include "Student.hpp" @@ -11,7 +13,11 @@ class check{ } }; -int main(int, char**){ +int main(int argc, char** argv){ + if(argc == 1 || std::string(argv[1]) != "-t"){ + std::cerr << "error: invalid argument\n"; + exit(-1); + } printf("Hello, from stl_debug!\n"); std::vector vec; Human human(25, "John Doe"); @@ -21,9 +27,17 @@ int main(int, char**){ for (const auto& h : vec) { std::cout << h->print(); } + // auto student1 = new Student(); //TODO: Error 1 : why? auto student1 = static_cast(vec.back()); - // check check1 = check(student); + // check check1 = check(student); //TODO: Error 2 : why? check check1 = check(student1); - LOG(DEBUG) << student1->print(); - LOG(WARNING) << human.print(); + // LOG(DEBUG) << student1->print(); + // LOG(WARNING) << human.print(); + + // std::list list; + // list.push_back(1); + // for(auto i: list){ + // list.remove(i); + // } + return 0; }