diff --git a/include/xo/object2/DList.hpp b/include/xo/object2/DList.hpp index 8009f7b5..ddc54f3f 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 7ef06f36..b9ac0583 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) {