Skip to content
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

Merged
merged 1 commit into from
Oct 28, 2022
Merged

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented Oct 21, 2022

No description provided.

@AZero13 AZero13 force-pushed the final branch 6 times, most recently from 8d79a52 to e6fc63d Compare October 22, 2022 18:47
@@ -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())
Copy link
Member

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.

@@ -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"; }
Copy link
Member

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.

@AZero13
Copy link
Contributor Author

AZero13 commented Oct 27, 2022

@BillyONeal Done!

Also use constexpr where we can
@BillyONeal BillyONeal merged commit 1e53a0c into microsoft:main Oct 28, 2022
@BillyONeal
Copy link
Member

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants