From a7f50bd2f6e029356b2390d4bee95f3baea6059f Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Fri, 30 Aug 2024 10:14:17 +0200 Subject: [PATCH] Add del operations for sequences, fixed #68 * XSC/be/CXX/Header.cpp: * XSC/be/CXX/Inline.cpp: --- XSC/be/CXX/Header.cpp | 1 + XSC/be/CXX/Inline.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/XSC/be/CXX/Header.cpp b/XSC/be/CXX/Header.cpp index 61a5494..6783853 100644 --- a/XSC/be/CXX/Header.cpp +++ b/XSC/be/CXX/Header.cpp @@ -203,6 +203,7 @@ namespace if (!this->cpp11_) { os << "void add_" << name << " (" << name << "_value_type const&);"; + os << "void del_" << name << " (" << name << "_value_type const&);"; } //Return referenced item if an IDREF if ((idref_ptr != std::string::npos) && (!this->cpp11_)) diff --git a/XSC/be/CXX/Inline.cpp b/XSC/be/CXX/Inline.cpp index 134a118..238d9bc 100644 --- a/XSC/be/CXX/Inline.cpp +++ b/XSC/be/CXX/Inline.cpp @@ -262,8 +262,14 @@ namespace << "void " << scope << "::" << endl << "add_" << name << " (" << scope << "::" << name << "_value_type const& e)" << "{"; - os << id(name) << "_.push_back (e);"; + os << "}\n"; + // add_typename + os << i + << "void " << scope << "::" << endl + << "del_" << name << " (" << scope << "::" << name << "_value_type const& e)" + << "{"; + os << id(name) << "_.remove (e);"; os << "}"; }