JustasMasiulis / circular_buffer

A constexpr STL style circular buffer implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception when using user defined class with stl containers as attribute

diegomazala opened this issue · comments

May suggest a test that fails?
Insert a vector as an attribute

struct leak_checker {

leak_checker() { ++num_constructions; }

~leak_checker() { ++num_deletions; }

leak_checker(const leak_checker&) { ++num_constructions; }

leak_checker(leak_checker&&) { ++num_constructions; }

leak_checker& operator=(const leak_checker&) = default;
leak_checker& operator=(leak_checker&&) = default;

std::vector<float> numbers;

};

Really sorry for the inconveniences. Personally used the library only for POD structs and had no problems.

I am not sure about which test are you talking about though as there was an error for me which I fixed. Can you check if it is all OK now?

I just updated the repo code and test it again. It failed at the first test called "quick test for leaks".
Please, see the message below

projectd.exe is a Catch v1.9.6 host application.
Run with -? for options

-------------------------------------------------------------------------------
quick test for leaks
-------------------------------------------------------------------------------
c:\users\diego\projects\circular_buffer.git\test\main.cpp(51)
...............................................................................

c:\users\diego\projects\circular_buffer.git\test\main.cpp(63): FAILED:
  REQUIRE( num_constructions == num_deletions )
with expansion:
  138 == 132
with message:
  constructions: 138deletions: 132

===============================================================================
test cases:    19 |    18 passed | 1 failed
assertions: 36519 | 36518 passed | 1 failed

Pressione qualquer tecla para continuar. . .

yep fixed