Skip to content

Refactor shared_str #1948

@Xottab-DUTY

Description

@Xottab-DUTY
  1. std::string/std::string_view like interface
    1. Get rid of operator*
    2. Prohibit direct comparison with nullptr (via providing std::nullptr_t overloads for operator== and xr_strcmp)
    3. Add functions from std::string/std::string_view
      1. Treat it as a view of immutable string and add functions accordingly reasonable
      2. Already existing printf is acceptable, but we should decide if we should leave or not
  2. Replace pointer with 32-bit identifier which will allow us to reduce the class size on 64-bit platforms
  3. Computational requirements:
    • O(1) – access the underlying string
    • O(1) – search
    • Insertion/removal don't have strict requirements, but just don't make it O(N^2).
      O(log N) is very good, O(N) is acceptable

References, useful links:

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions