diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c27059..50b785a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,8 @@ project(libprlearn VERSION 1.0.0 LANGUAGES CXX) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif(NOT CMAKE_BUILD_TYPE) -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wpedantic") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG -Wall -Wpedantic") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Wpedantic") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG -Wall -Wextra -Wpedantic") set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_CXX_STANDARD 17) diff --git a/src/structs.h b/src/structs.h index 88d39e7..6ca44fa 100644 --- a/src/structs.h +++ b/src/structs.h @@ -39,7 +39,10 @@ namespace prlearn { double _avg = 0; double _cnt = 0; - inline void addPoints(avg_t other) { + constexpr avg_t() = default; + constexpr avg_t(const avg_t&) = default; + + inline void addPoints(const avg_t& other) { addPoints(other._cnt, other._avg); } @@ -91,8 +94,7 @@ namespace prlearn { struct qvar_t : private avg_t { - qvar_t() { - }; + qvar_t() = default; qvar_t(double d, double w, double v) { _avg = d;