Skip to content

static variable definitions #119

Open

Description

@yakra

Static variables can be defined within a class definition; doesn't have to be later.

Activity

  1. yakra commented on Apr 5, 2020

    @yakra
    OwnerAuthor

    Arguments can be cleaned up

  2. yakra commented on May 2, 2020

    @yakra
    OwnerAuthor

    Apparently I can only do this with integral types? OK...

    • Done for HGEdge format constants
    • Waypoint::pi #defined instead
    • Arguments has enough non-integral types (strings) that the cleanest solution is to leave as-is.
  3. yakra commented on May 3, 2020

    @yakra
    OwnerAuthor
    • Make region_hash a static member of region
  4. yakra commented on Mar 20, 2022

    @yakra
    OwnerAuthor

    WRT the above comment and finding other variables in main or wherever to put in a class, those can be done as I notice them. No need to go searching.

    WRT the OP, seems only const values work (search "Constant static members").

    • Thus GraphListEntry::num must stay as-is, right?

    All items specifically mentioned are addressed, or no-build. Only other thing that matches the OP might be...

    • DBFieldlength would be perfect for this. Could do away with the .cpp file entirely. Variables would probably be constexpr (links: demystifying / when to use)?
    • To that end, if the HGEdge consts were constexpr, would it compile differently?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions