test/util/TestIntrusiveForwardList: implement size() only if options.constant_time_size
is set
This commit is contained in:
parent
175524ad02
commit
6f7dce6dca
@ -178,11 +178,9 @@ public:
|
|||||||
return head.next == nullptr;
|
return head.next == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr size_type size() const noexcept {
|
constexpr size_type size() const noexcept
|
||||||
if constexpr (constant_time_size)
|
requires(constant_time_size) {
|
||||||
return counter;
|
return counter;
|
||||||
else
|
|
||||||
return std::distance(begin(), end());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() noexcept {
|
void clear() noexcept {
|
||||||
|
Loading…
Reference in New Issue
Block a user