pytorch
19d8d31c - [fbcode/caffe2] Make fmt formatter methods const (#100616)

Commit
1 year ago
[fbcode/caffe2] Make fmt formatter methods const (#100616) Summary: Staging an update to the latest fmt version triggered lots of build errors due to non-`const` methods on custom formatters. This fixes the `format()` methods to be `const` as they don't mutate any state anyway, as well as `parse()` methods that don't need to mutate internal state. This mitigates many future build errors. Updates were identified and executed by using regular expression search/replacements such as: `(constexpr auto parse\(ParseContext& [^)]*\)) \{` -> `$1 const {` `(constexpr auto parse\(ParseContext& [^)]*\)) ->` -> `$1 const ->` `(auto format\(.*, FormatContext& [^)]*\)) \{` -> `$1 const {` `(auto format\(.*, FormatContext& [^)]*\)) ->` -> `$1 const ->` Any changes to third-party code was then reverted. Some small changes detected from subsequent build errors were then applied. Test Plan: CI Differential Revision: D45463620 Pull Request resolved: https://github.com/pytorch/pytorch/pull/100616 Approved by: https://github.com/davidberard98
Author
Committer
Parents
Loading