Add explicit nint cast operator to `PWSTR`.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.5k
- Forks
- 124
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
It's common to need to work with the underlying pointer.
Describe the solution you'd like
public static explicit operator nint(PWSTR pwstr)
{
unsafe
{
return (nint)pwstr.Value;
}
}
Describe alternatives you've considered
I can add an extension method for this, but I can't add extension operators. This means i can't use a natural cast like I can with other pointed to types.
Additional context
N/A
Contributor guide
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 by locating the PWSTR type and its existing conversion operators. Add the requested explicit nint conversion using the underlying Value pointer, then run the repository's relevant build or tests to confirm the type compiles and the cast works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100