Skip to content

Commit

Permalink
Merge pull request #73 from jwillemsen/jwi-adddel
Browse files Browse the repository at this point in the history
Add del operations for sequences
  • Loading branch information
jwillemsen authored Aug 30, 2024
2 parents 0e427e6 + 12981ba commit f062fb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions XSC/be/CXX/Header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_))
Expand Down
8 changes: 7 additions & 1 deletion XSC/be/CXX/Inline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 << "}";
}

Expand Down

0 comments on commit f062fb3

Please sign in to comment.