How can I Declare CircularBuffer variable first and initialize later? #77
Replies: 3 comments
-
I'm currently facing the same issue. Facing it when I try to declare the CircularBuffer as member variable in a class. It seems to call the copy constructor (which is deleted) upon initialization of the class that has the CircularBuffer as member. Any help would be much appriciated! |
Beta Was this translation helpful? Give feedback.
-
I moved your request to the discussions section, hopefully, some other users might help you. Personally I created and use this structure in a microcontroller context, thus I haven't ever faced this issue. |
Beta Was this translation helpful? Give feedback.
-
I believe I have an answer for this request: the CircularBuffer is allocated on the stack, not on the heap, and this is more than probably the culprit for your issues. There is a closed pull request I invite you to test: if that represents a solution, I will happily merge the PR. |
Beta Was this translation helpful? Give feedback.
-
How can I Declare variable first and initialize later?
like this:
CircularBuffer cb_variable;
How can I Declare a CircularBuffer pointer and point to a CircularBuffer object?
CircularBuffer * cb_variable_ptr;
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions