mirror of https://github.com/ARMmbed/mbed-os.git
moved initialization into constructor for compatibility with c++03
parent
250ce08712
commit
cad87d11d4
|
@ -22,6 +22,7 @@
|
|||
template <class T, int Size>
|
||||
class CircBuffer {
|
||||
public:
|
||||
CircBuffer():write(0), read(0){}
|
||||
bool isFull() {
|
||||
return ((write + 1) % size == read);
|
||||
};
|
||||
|
@ -53,9 +54,9 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
volatile uint16_t write{0}; //in case older compilers are targeted this should be done in a constructor
|
||||
volatile uint16_t read{0};
|
||||
static constexpr int size{Size+1};
|
||||
volatile uint16_t write;
|
||||
volatile uint16_t read;
|
||||
static const int size = Size+1;
|
||||
T buf[Size];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue