darray: correct the empty condition
This commit is contained in:
parent
26edf25b82
commit
8c0c374a53
@ -89,7 +89,7 @@ namespace cruft {
|
||||
constexpr auto capacity (void) const noexcept { return CapacityV; }
|
||||
constexpr auto remain (void) const noexcept { return capacity () - size (); }
|
||||
|
||||
constexpr bool empty (void) const noexcept { return !!m_size; }
|
||||
constexpr bool empty (void) const noexcept { return m_size == 0; }
|
||||
constexpr bool full (void) const noexcept { return m_size == CapacityV; }
|
||||
|
||||
|
||||
|
@ -6,6 +6,11 @@ main (int, char**)
|
||||
{
|
||||
cruft::TAP::logger tap;
|
||||
|
||||
{
|
||||
cruft::darray<8,int> val;
|
||||
tap.expect (val.empty (), "default initialisation is empty");
|
||||
}
|
||||
|
||||
{
|
||||
cruft::darray<8,int> val ({ 0, 1, 2, 3, 4, 5, 6, 7});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user