Skip to content

Please post example of specialization for boost::filesystem #692

Description

@solvingj

You gave an example for boost::optional which was very nice, however i spent some time trying to adapt with no success, here was my best guess.

  template<>
  struct adl_serializer<boost::filesystem::path>
  {
    static void to_json(json& j, const boost::filesystem::path& path)
    {
      j = path.string();
    }

    static void from_json(const json& j, boost::filesystem::path& path)
    {
      path = boost::filesystem::path(j);
    }
  };
  

Can you please advise?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    solution: proposed fixa fix for the issue has been proposed and waits for confirmation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions