Skip to content

Using versioned namespaces #1539

Closed
@naszta

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;

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions