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

SymbolGenerator: add chr() and made constexpr-capable #629

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

jlblancoc
Copy link
Member

That it is:

  • add a chr() method to recover the underlying char symbol, and
  • Make possible to write things like:
constexpr auto sQpp = gtsam::SymbolGenerator('a');
//...

    for (const auto &kv : values) {
      gtsam::Symbol s(kv.key);
      switch (s.chr()) {
      case sQpp.chr():    // this requires SymbolGenerator to be constexpr
        // ...
      }
   }

Copy link
Collaborator

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@varunagrawal varunagrawal merged commit 13db697 into develop Dec 3, 2020
@varunagrawal varunagrawal deleted the feature/constexpr-symbolgenerator branch December 3, 2020 15:15
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

Successfully merging this pull request may close these issues.

2 participants