rlogiacco / CircularBuffer

Arduino circular buffer library
GNU Lesser General Public License v3.0
312 stars 85 forks source link

Can't use library within a class. #47

Closed gnalbandian closed 3 years ago

gnalbandian commented 3 years ago

Hi. I am trying to use this library as an object within a class and I am getting the following error:

error: use of deleted function 'constexpr CircularBuffer<timeTempStruct, 10u>::CircularBuffer(const CircularBuffer<timeTempStruct, 10u>&)'

The class is globally instanced as:

className objectName[8] = className (constructor arguments);

Any tip on how to make this work? Thanks!

Regards! Gonzalo

gnalbandian commented 3 years ago

Solved by not using copy constructor when instantiating the class.

dzalf commented 8 months ago

@gnalbandian Sorry for reviving this thread so late. How exactly did you manage to solve this?

I am facing exactly the same issue:

image
gnalbandian commented 8 months ago

Please, check out this https://github.com/gnalbandian/RunningAverage