Add _bstr user-defined literal for BSTR-shaped wide strings#647
Merged
Conversation
C++20 only. Captures the literal as a class-type NTTP so storage is
sized exactly to the literal length; constexpr-constructible, no heap,
no lifetime hazards.
void Use(BSTR);
Use(L\"foo\"_bst);
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmachaj
reviewed
Jun 27, 2026
dunhor
reviewed
Jul 1, 2026
dunhor
reviewed
Jul 1, 2026
dunhor
reviewed
Jul 1, 2026
dunhor
reviewed
Jul 1, 2026
dunhor
requested changes
Jul 6, 2026
Co-authored-by: Duncan Horn <40036384+dunhor@users.noreply.github.com>
…ding-bstr-literal
dunhor
approved these changes
Jul 14, 2026
Document the two environment gaps that prevent 'scripts\format-changes.cmd' from working: the LLVM bin directory must be on PATH (VS's clang-format does not ship git-clang-format), and a 'python3' executable must be resolvable (disable the Microsoft Store python3 alias on Windows). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f00e394c-d4c3-47db-a66b-b516ed304a93
_bst user-defined literal for BSTR-shaped wide strings_bstr user-defined literal for BSTR-shaped wide strings
dunhor
approved these changes
Jul 17, 2026
dunhor
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduce global initializers and intermediate allocations with a
BSTR-compatible string literal.Instead, literals:
(Thanks Copilot!)