xo-gc xo-object2 xo-facet: builds w/ ISequence,Dlist
This commit is contained in:
parent
519df04e34
commit
afc44e71fa
26 changed files with 717 additions and 75 deletions
|
|
@ -11,13 +11,23 @@ namespace xo {
|
|||
namespace scm {
|
||||
|
||||
struct DList {
|
||||
using size_type = std::size_t;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
|
||||
DList(xo::obj<AGCObject> h,
|
||||
xo::obj<AGCObject> r) : head_{h}, rest_{r} {}
|
||||
DList * r) : head_{h}, rest_{r} {}
|
||||
|
||||
/** DList length is at least 1 **/
|
||||
bool is_empty() const noexcept { return false; };
|
||||
/** DList models a finite sequence **/
|
||||
bool is_finite() const noexcept { return true; };
|
||||
/** return number of elements in this DList **/
|
||||
size_type size() const noexcept;
|
||||
/** return element at 0-based index @p ix **/
|
||||
obj<AGCObject> at(size_type ix) const;
|
||||
|
||||
obj<AGCObject> head_;
|
||||
obj<AGCObject> rest_;
|
||||
DList * rest_ = nullptr;
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue