diff --git a/include/xo/object2/DList.hpp b/include/xo/object2/DList.hpp index 8009f7b..ddc54f3 100644 --- a/include/xo/object2/DList.hpp +++ b/include/xo/object2/DList.hpp @@ -57,6 +57,8 @@ namespace xo { /** return element at 0-based index @p ix **/ obj at(size_type ix) const; + /** assign head **/ + void assign_head(obj gc, obj h); /** assign rest-pointer **/ void assign_rest(DList * r); diff --git a/src/object2/DList.cpp b/src/object2/DList.cpp index 7ef06f3..b9ac058 100644 --- a/src/object2/DList.cpp +++ b/src/object2/DList.cpp @@ -119,6 +119,14 @@ namespace xo { return l->head_; } + void + DList::assign_head(obj gc, obj rhs) + { + scope log(XO_DEBUG(true), xtag("gc.data", gc.data_)); + + mm_do_assign(gc, this, &head_, rhs); + } + void DList::assign_rest(DList * r) {