mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 02:21:34 +08:00
Added [[nodiscard]] qualifiers to circular_q
This commit is contained in:
parent
55f84d458b
commit
d8829e7714
@ -61,20 +61,22 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return reference to the front item.
|
// Return const reference to the front item.
|
||||||
// If there are no elements in the container, the behavior is undefined.
|
// If there are no elements in the container, the behavior is undefined.
|
||||||
const T &front() const
|
[[nodiscard]] const T &front() const
|
||||||
{
|
{
|
||||||
return v_[head_];
|
return v_[head_];
|
||||||
}
|
}
|
||||||
|
|
||||||
T &front()
|
// Return reference to the front item.
|
||||||
|
// If there are no elements in the container, the behavior is undefined.
|
||||||
|
[[nodiscard]] T &front()
|
||||||
{
|
{
|
||||||
return v_[head_];
|
return v_[head_];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return number of elements actually stored
|
// Return number of elements actually stored
|
||||||
size_t size() const
|
[[nodiscard]] size_t size() const
|
||||||
{
|
{
|
||||||
if (tail_ >= head_)
|
if (tail_ >= head_)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user