mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpiutil] circular_buffer: Use value initialization instead of passing zero (#3303)
This enables use of types that have a no-args constructor rather than one that takes an explicit zero value. For numeric types, value initialization will result in a zero value, so this is not a functional change.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
namespace wpi {
|
||||
|
||||
template <class T>
|
||||
circular_buffer<T>::circular_buffer(size_t size) : m_data(size, T{0}) {}
|
||||
circular_buffer<T>::circular_buffer(size_t size) : m_data(size, T{}) {}
|
||||
|
||||
/**
|
||||
* Returns number of elements in buffer
|
||||
|
||||
Reference in New Issue
Block a user