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

Update template to follow best practices in namespace use (Issue #1823) #4851

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MuyuanMS
Copy link

@MuyuanMS MuyuanMS commented Nov 5, 2024

Addressing issue #1823 and update the template on the namespace, in order to address compiling error when projects that uses C++/WinRT along with C++/CX and/or WRL

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

@MuyuanMS
Copy link
Author

MuyuanMS commented Nov 5, 2024

@MuyuanMS please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

@Scottj1s
Copy link
Member

Scottj1s commented Nov 5, 2024

nesting the Microsoft::UI::Xaml under winrt explicitly is a good change to remove ambiguity.
but removing the "using namespace winrt;" will just require most users to go add it back.

as this comment notes,
"using the winrt namespace is fine as long as the project only uses C++/WinRT and doesn't use C++/CX and/or WRL along with it."

that's the default for most projects (not combining with CX and/or WRL), so we should continue optimizing for that

@codendone
Copy link
Contributor

⁠I have a couple of times hit conflicts with "IInspectable" due to not specifying the namespace. But maybe that isn't the normal experience.

I agree the C++/WinRT along with C++/CX is not a scenario for majority customers.


In reply to: 2458215921

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

Successfully merging this pull request may close these issues.

3 participants