-
Notifications
You must be signed in to change notification settings - Fork 588
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Motivation
w! allows you to create a &'static HSTRING, but .as_ptr() and other conversions don't seem to be const, so it doesn't seem possible to get a const PCWSTR from it, in const context. Currently I'm using wchar::wchz! as alternative: PCWSTR::from_raw(wchz!("my string").as_ptr()). It would be nice to have a built-in way to do this.
Another tiny one is to create a const null-PCWSTR, but PCWSTR::null is not marked as const. PCWSTR(std::ptr::null()) is the slightly uglier workaround :)
The same should be the case for the other string types (PWSTR, and the 8bit string types). null(), as_ptr() and is_null() all can be marked as const fn as far as I can tell.
Drawbacks
No response
Rationale and alternatives
No response
Additional context
No response
kennykerr
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request