From 095e982db403f0be8a13e836b735654946c7a663 Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Tue, 25 Oct 2022 11:27:56 +0200 Subject: [PATCH] #249: Update comments in the examples --- ...point_example_polymorphic_macro_nonintrusive.cc | 4 ---- .../checkpoint_example_to_file_nonintrusive.cc | 14 +++++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc b/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc index 98e90322..8ae07db1 100644 --- a/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc +++ b/examples/checkpoint_example_polymorphic_macro_nonintrusive.cc @@ -111,10 +111,6 @@ struct MyObj3 : public MyBase { } }; -/* - * Example vector that holds a vector of unique_ptr to MyBase - */ - struct ExampleVector { std::vector> vec; }; diff --git a/examples/checkpoint_example_to_file_nonintrusive.cc b/examples/checkpoint_example_to_file_nonintrusive.cc index 3fc13498..2fd65a32 100644 --- a/examples/checkpoint_example_to_file_nonintrusive.cc +++ b/examples/checkpoint_example_to_file_nonintrusive.cc @@ -60,7 +60,7 @@ struct MyTestType { // \brief Default constructor // // The default constructor is needed for the (de)serialization. - // (required for serialization) + // MyTestType() = default; // \brief Constructor with two parameters @@ -148,10 +148,12 @@ int main(int, char**) { // auto out = checkpoint::deserializeFromFile("hello.txt"); - if (my_test_inst == *out) + if (my_test_inst == *out) { std::cout << " Serialization / Deserialization from file worked. \n"; - else + } else { std::cout << " Serialization / Deserialization from file failed. \n"; + assert(false); + } // // Another option is to de-serialize into an existing object of type 'MyTestType' @@ -170,10 +172,12 @@ int main(int, char**) { // - an integer 'len_' equal to the length of the vector stored in the file. // - if (my_test_inst == out_2) + if (my_test_inst == out_2) { std::cout << " Deserialization in-place from file worked. \n"; - else + } else { std::cout << " Deserialization in-place from file failed. \n"; + assert(false); + } return 0; }