Hans,
Yes, that is the sort of thing where it makes sense to use C++. However, since it's supposed to be usable within both C and C++ projects, I had to keep it regular C unless I wanted to provide two separate implementations. I suppose for C interoperability you could provide a C++ wrapper around it so that the same buffer could be accessed via both languages, but I haven't found a pressing use-case for it yet.
Cheers!
- Dean
On Saturday, July 28, 2012 8:47:25 PM UTC+2, Hans Schou wrote:
Hi
I'm starting to learn how to handle C++ classes in AVR-GCC and here the LUFA/Drivers/Misc/RingBuffer.h might actually be a good example. This is not a LUFA question but I hope that is OK.
Why is the RingBuffer not a C++ class?
How much more code and RAM will a class take up and how much execution time should one expect a class will take compared to the lightweight C model?
/hans