JustasMasiulis / circular_buffer

A constexpr STL style circular buffer implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create buffer from user defined class

diegomazala opened this issue · comments

I couldn't use your circular_buffer with any of my defined types. For instance, none of the classes defined here https://en.cppreference.com/w/cpp/language/rule_of_three
I am using msvc 2017 and it throws an error nad a warning:

  • warning C4624: 'jm::circular_buffer<my_type,3>': destructor was implicitly defined as deleted
  • 'jm::circular_buffer<my_type,3>::~circular_buffer(void)': attempting to reference a deleted function

Thanks

Thanks for reporting this.
The problem was that the storage class which is an union had either defaulted or no destructor defined. When the type had a non trivial destructor this became a problem.

TLDR: should be fixed now (for c++11 and up at least).