-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark functions as static and const #764
Conversation
8d79a52
to
e6fc63d
Compare
include/vcpkg/base/format.h
Outdated
@@ -25,7 +25,7 @@ namespace fmt | |||
template<> | |||
struct formatter<vcpkg::LineInfo, char> | |||
{ | |||
constexpr auto parse(format_parse_context& ctx) const -> decltype(ctx.begin()) | |||
static constexpr auto parse(format_parse_context& ctx) -> decltype(ctx.begin()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I indicated in the other PR, this is following the formatter protocol, so this change damages correctness. https://fmt.dev/latest/api.html#formatting-user-defined-types
(fmt wants to call with a.b
syntax not a::b
syntax)
Adding const would be OK.
src/vcpkg-test/expected.cpp
Outdated
@@ -76,7 +76,8 @@ namespace | |||
++cr->move_assigns; | |||
return *this; | |||
} | |||
std::string to_string() const { return "a construct tracker"; } | |||
|
|||
static std::string to_string() { return "a construct tracker"; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer following the obj.to_string() protocol.
@BillyONeal Done! |
Also use constexpr where we can
Thanks :) |
No description provided.