C++ circular_buffer: support types not implicitly convertible from int (#2350)

Also fixes two cases of returning a reference to a constant.
This commit is contained in:
Oblarg
2020-02-08 16:35:21 -05:00
committed by GitHub
parent 1b85066d26
commit 05b7593e66
2 changed files with 10 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -47,6 +47,8 @@ class circular_buffer {
private:
std::vector<T> m_data;
T zero_val{0};
// Index of element at front of buffer
size_t m_front = 0;