Replies: 1 comment
-
The thing to remember is that using is a typedef. To provide a short and silly example, including names that are hard to confuse with each other:
Using a fully qualified name overrides the typedef, it is only if the name is unqualified that any type definitions are taken into account. What's more, C++ has interesting scoping rules.
This means that the type definition can always be overridden at any scope. Finally, to extend the code around that set of using statements up a little:
The type definition is in a namespace. Because of the points I made, the only way this could be causing issues is if you are using a typedef or the using statement to remove your Uri namespace at a global level, and the generated implementation is overriding you in the component's namespace. Doing this kind of thing at global scope, especially in headers, tends to be seen as bad practice. If you want to reduce typing, then either use a namespace alias, or do this in a .cpp file at a more restrictive level. |
Beta Was this translation helpful? Give feedback.
-
why add
using Uri = ::winrt::Windows::Foundation::Uri;
in line 39this could easily conflict whith my definition class Uri.
Beta Was this translation helpful? Give feedback.
All reactions