diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b03772..83dea4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ macro(compile_options target_name) sanitizers(${target_name}) endmacro() -project(blt-gp VERSION 0.5.15) +project(blt-gp VERSION 0.5.16) include(CTest) diff --git a/lib/blt b/lib/blt index 2bac310..fb09242 160000 --- a/lib/blt +++ b/lib/blt @@ -1 +1 @@ -Subproject commit 2bac310e55df06a3e378c932afa2a4c2bc2123e7 +Subproject commit fb092422a82e503d314fc5c99eacb306c29386e8 diff --git a/src/program.cpp b/src/program.cpp index 48b6db1..95ca853 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -17,6 +17,7 @@ */ #include #include +#include #ifndef BLT_ASSERT_RET #define BLT_ASSERT_RET(expr) if (!(expr)) { return false; } diff --git a/tests/serialization_test.cpp b/tests/serialization_test.cpp index 09fa1cd..8d9ca95 100644 --- a/tests/serialization_test.cpp +++ b/tests/serialization_test.cpp @@ -26,59 +26,48 @@ #include #include - -struct no_default +struct default_type { - no_default() = delete; - - no_default(int) + std::string to_string() // NOLINT { + return "Unimplemented"; } }; -struct not_copyable +struct type1 : default_type { - not_copyable() = default; - not_copyable(const not_copyable&) = delete; + std::string to_string() // NOLINT + { + return "type1"; + } }; -struct copyable +struct type2 : default_type { - copyable() = default; - copyable(const copyable&) = default; + std::string to_string() // NOLINT + { + return "type2"; + } }; -struct copyable_nothrow +struct type3 : default_type { - copyable_nothrow() = default; - copyable_nothrow(const copyable_nothrow&) noexcept = default; + std::string to_string() // NOLINT + { + return "type3"; + } }; -struct not_movable +void test() { - not_movable() = default; - not_movable(not_movable&&) = delete; -}; + blt::variant_t some_type1{type1{}}; + blt::variant_t some_type2{type2{}}; + blt::variant_t some_type3{type3{}}; -struct movable -{ - movable() = default; - movable(movable&&) = delete; -}; - -struct movable_nothrow -{ - movable_nothrow() = default; - movable_nothrow(movable_nothrow&&) noexcept = delete; -}; - -blt::variant_t no_default_variant; -blt::variant_t not_copyable_variant; -blt::variant_t copyable_variant; -blt::variant_t copyable_nothrow_variant; -blt::variant_t not_movable_variant; -blt::variant_t movable_variant; -blt::variant_t movable_nothrow_variant; + BLT_TRACE("TYPE1: {}", some_type1.call_member(&default_type::to_string)); + BLT_TRACE("TYPE2: {}", some_type2.call_member(&default_type::to_string)); + BLT_TRACE("TYPE3: {}", some_type3.call_member(&default_type::to_string)); +} using namespace blt::gp; @@ -144,6 +133,8 @@ bool fitness_function(const tree_t& current_tree, fitness_t& fitness, size_t) int main() { + test(); + return 0; operator_builder builder{}; const auto& operators = builder.build(addf, subf, mulf, pro_divf, op_sinf, op_cosf, op_expf, op_logf, litf, op_xf); regression.get_program().set_operations(operators);