Replace static_lazy<> with normal statics
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3k
- Forks
- 300
- Avg merge
- 19h 12m
- Merged PRs (30d)
- 1
Description
According to https://learn.microsoft.com/en-us/cpp/cpp/storage-classes-cpp?view=msvc-170, function-local "magic statics" are fully supported.
Instead of defining a custom static_lazy type, use the built-in support.
- Remove static_lazy<>
- On line 2283ish in the
Instance()method:
static TraceLoggingClassName* Instance() WI_NOEXCEPT \
{ \
static TraceLoggingClassName wrapper; \
return wrapper; \
} \
friend class wil::details::static_lazy<TraceLoggingClassName>;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/wil/Tracelogging.h at lines 188-204 and inspect the Instance() method around line 2283. Replace the custom static_lazy usage with the supported function-local static as described, then verify that the custom type and its friendship are no longer needed. Done means the requested references have been removed without changing the wrapper's behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100