diff --git a/example/doc_complex_map.cpp b/example/doc_complex_map.cpp index 2d40086..63c90b6 100644 --- a/example/doc_complex_map.cpp +++ b/example/doc_complex_map.cpp @@ -44,6 +44,11 @@ class complex_data : id_(id), char_string_(name, void_alloc), int_vector_vector_(void_alloc) {} //Other members... + //<- + int get_id() { return id_; }; + char_string get_char_string() { return char_string_; }; + int_vector_vector get_int_vector_vector() { return int_vector_vector_; }; + //-> }; //Definition of the map holding a string as key and complex_data as mapped type diff --git a/example/doc_managed_allocation_command.cpp b/example/doc_managed_allocation_command.cpp index c5e7fa1..e1e0cf4 100644 --- a/example/doc_managed_allocation_command.cpp +++ b/example/doc_managed_allocation_command.cpp @@ -88,6 +88,9 @@ int main() //Get free memory and compare managed_shared_memory::size_type free_memory_after_expansion = managed_shm.get_free_memory(); assert(free_memory_after_expansion < free_memory_after_allocation); + //<- + (void)free_memory_after_expansion; + //-> //Write new values for(std::size_t i = first_received_size; i < expanded_size; ++i) ptr[i] = i; @@ -109,6 +112,9 @@ int main() //Get free memory and compare managed_shared_memory::size_type free_memory_after_shrinking = managed_shm.get_free_memory(); assert(free_memory_after_shrinking > free_memory_after_expansion); + //<- + (void)free_memory_after_shrinking; + //-> //Deallocate the buffer managed_shm.deallocate(ptr); diff --git a/test/shared_ptr_test.cpp b/test/shared_ptr_test.cpp index b523acc..1785845 100644 --- a/test/shared_ptr_test.cpp +++ b/test/shared_ptr_test.cpp @@ -274,7 +274,7 @@ struct X { X(){ ++cnt; } // virtual destructor deliberately omitted - ~X(){ --cnt; } + virtual ~X(){ --cnt; } virtual int id() const { return 1; } @@ -287,7 +287,7 @@ struct X struct Y: public X { Y(){ ++cnt; } - ~Y(){ --cnt; } + virtual ~Y(){ --cnt; } virtual int id() const { return 2; }