Library: expose some diagnostics on IterStack / IterQueue by default
seems like most usages will want to expose this kind of diagnostics for unit testing and in fact the queue or stack nature is the primary nature of this entity, while iterability comes as additional trait
This commit is contained in:
parent
3dea3c0fa0
commit
56def9f6d7
2 changed files with 32 additions and 16 deletions
|
|
@ -67,8 +67,9 @@
|
|||
|
||||
namespace lib {
|
||||
|
||||
using util::unConst;
|
||||
|
||||
namespace iter {
|
||||
using util::unConst;
|
||||
|
||||
/**
|
||||
* Wrapper to mark a std::deque instance for use
|
||||
|
|
@ -153,6 +154,21 @@ namespace lib {
|
|||
this->stateCore().pop_back();
|
||||
return topElement;
|
||||
}
|
||||
|
||||
|
||||
/* == diagnostics == */
|
||||
|
||||
size_t
|
||||
size() const
|
||||
{
|
||||
return unConst(this)->stateCore().size();
|
||||
}
|
||||
|
||||
bool
|
||||
empty() const
|
||||
{
|
||||
return 0 == size();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -208,6 +224,21 @@ namespace lib {
|
|||
}
|
||||
|
||||
|
||||
/* == diagnostics == */
|
||||
|
||||
size_t
|
||||
size() const
|
||||
{
|
||||
return unConst(this)->stateCore().size();
|
||||
}
|
||||
|
||||
bool
|
||||
empty() const
|
||||
{
|
||||
return 0 == size();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adapter for use as opaque sequence.
|
||||
* This builder exposes generic operations
|
||||
|
|
|
|||
|
|
@ -87,21 +87,6 @@ namespace control {
|
|||
{
|
||||
this->stateCore().clear();
|
||||
}
|
||||
|
||||
|
||||
/* == diagnostics == */
|
||||
|
||||
size_t
|
||||
size() const
|
||||
{
|
||||
return unConst(this)->stateCore().size();
|
||||
}
|
||||
|
||||
bool
|
||||
empty() const
|
||||
{
|
||||
return 0 == size();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue