Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated c++ code needs should be compatible with c++17 and above #51

Open
fbergmann opened this issue Jan 26, 2021 · 0 comments
Open

Comments

@fbergmann
Copy link
Member

As discussed in this issue: sbmlteam/libsbml#36, the current libSBML only compiles with c++ standard up to 14. This is because of the use of unary_function and ptr_function. The code compiles fine without these, so all that needs doing is not to inherit from unary functions.

Deviser generates them for finding elements by id or reference:

 /**
  * Used by ListOf::get() to lookup an SBase based by its id.
  */
 struct IdEqS : public unary_function<SBase*, bool>
 {
   const string& mId;
 
   IdEqS (const string& id) : mId(id) { }
   bool operator() (SBase* sb) 
        { return static_cast <Species *> (sb)->getId() == mId; }
 };

this struct will work just as well, by not using the unary_function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant