BaldDemian opened a new pull request, #3789: URL: https://github.com/apache/fory/pull/3789
## Why? C++ temporal types (date, duration, timestamp) should be hashable so they can be used as key in `unordered_map`. ## What does this PR do? 1. Define `fory::serialization::Timestamp` and `fory::serialization::Duration` as wrapper types for `std::chrono::time_point` and `std::chrono::nanoseconds`, instead of their aliases. Inside these wrapper types, conversion APIs to and from the chrono representations are provided. 2. Specify `std::hash` for temporal types (date, duration, timestamp). 3. Add serializers for raw `std::chrono::time_point` and `std::chrono::nanoseconds`. 4. Modify/Add testcases accordingly. 5. Modify the doc accordingly. ## Related issues Fixes https://github.com/apache/fory/issues/3787. ## AI Contribution Checklist <!-- Full requirements and disclosure template: https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs --> - [ ] Substantial AI assistance was used in this PR: `yes` / `no` - [ ] If `yes`, I included a completed [AI Contribution Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs) in this PR description and the required `AI Usage Disclosure`. - [ ] If `yes`, my PR description includes the required `ai_review` summary and screenshot evidence or equivalent persisted links of the final clean AI review results from both fresh reviewers described in `AI_POLICY.md`, the Fory-guided reviewer and the independent general reviewer, on the current PR diff or current HEAD after the latest code changes. <!-- If substantial AI assistance = `yes`, paste the completed checklist and disclosure block here, including the final ai_review summary and screenshot evidence or equivalent persisted links from both fresh reviewers described in AI_POLICY.md, the Fory-guided reviewer and the independent general reviewer, on the current PR diff or current HEAD after the latest code changes. --> ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> Yes. The changes are documented accordingly. - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
