Skip to content

Using versioned namespaces #1539

Closed

Description

@naszta
  • Describe the feature in as much detail as possible.
    In huge environments libraries and binaries might be compiled in different times. As this library is header only it has no dynamic linked library so from an ldd command the user is not able to detect which json library version is used in its dependencies. Using several version of json library accidentally might cause linking issues when the same function in the same namespace have different implementations. My idea is: the implementation namespace would contain the library version and we create an alias to it (so all currently implemented code could be the same while several versions of jsons could be used in the same binary silently).

  • Include sample usage where appropriate.
    We build a so, a file with json version 3.4.0, but the binary is built by 3.6.0.

  • possible implementation:
    namespace nlohmann should be changed to
    namespace nlohmann_json_3_6_0 and the last line of the header should be:
    namespace nlohmann = nlohmann_json_3_6_0;

Activity

  1. nlohmann commented on Mar 22, 2019

    @nlohmann
    Owner

    Related #1394

  2. nlohmann commented on Mar 23, 2019

    @nlohmann
    Owner

    I had a brief look and this seems to be a lot of work... Any volunteers?

  3. naszta commented on Mar 23, 2019

    @naszta
    ContributorAuthor

    I’m happy to do.

  4. naszta commented on Apr 2, 2019

    @naszta
    ContributorAuthor

    Hopefully on weekend I'll have time to do it.

  5. stale commented on May 2, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  6. added
    state: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated
    on May 2, 2019
  7. removed
    state: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated
    on Jul 23, 2022
  8. added
    state: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated
    and removed on Jul 23, 2022
  9. removed
    state: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated
    on Jul 23, 2022
  10. added this to the Release 3.11.0 milestone on Jul 23, 2022
  11. self-assigned this
    on Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址