-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Enable WINRT_LEAN_AND_MEAN #15215
Enable WINRT_LEAN_AND_MEAN #15215
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,27 @@ | |
#include "CommandPalette.g.h" | ||
#include "AppCommandlineArgs.h" | ||
|
||
struct hash_winrt_object_as_pointer | ||
{ | ||
size_t operator()(const ::winrt::Windows::Foundation::IUnknown& value) const noexcept | ||
{ | ||
void* const abi_value = winrt::get_abi(value.try_as<::winrt::Windows::Foundation::IUnknown>()); | ||
return std::hash<void*>{}(abi_value); | ||
} | ||
}; | ||
|
||
namespace std | ||
{ | ||
template<> | ||
struct hash<::winrt::Windows::UI::Xaml::DataTemplate> : public hash_winrt_object_as_pointer | ||
{ | ||
}; | ||
template<> | ||
struct hash<::winrt::Windows::UI::Xaml::Controls::Primitives::SelectorItem> : public hash_winrt_object_as_pointer | ||
{ | ||
}; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also just pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's fair. i was going for "maximal equivalence in minimal lines deleted". I'll probably move over to this |
||
|
||
// fwdecl unittest classes | ||
namespace TerminalAppLocalTests | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extra
try_as
seems redundant? It might make sense to door alternatively
Due to the novel design choices in
std::unordered_map
I suspect there's not a particularly big difference between the two though, so I don't think it matters what you pick.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh. I copied this directly out of
winrt/base.h
.