0

I'm asking for the cppwinrt version of this c# question: Implementing INotifyPropertyChanged - does a better way exist?

As far as I can tell you cant define you own parameterized/generic types in idl.

What do people do? Just have a .idl .h .cpp for each instantiation and copy paste like mad?

Could someone explain how static reflection on function signatures enables a generic implementation?

Tom Huntington
  • 2,260
  • 10
  • 20
  • 1
    With [`std::source_location`](https://en.cppreference.com/w/cpp/utility/source_location) we can finally write a generic implementation. – IInspectable Jun 24 '23 at 06:36
  • @IInspectable "we can finally write" sounds like you recommending that I try to do this. Are you? If so could you sketch the process please? It's not clear to me how static reflection on function signatures enables this – Tom Huntington Jun 24 '23 at 07:18
  • I said *"finally"*, because extracting a string representation of the current function's name was the only missing ingredient in writing a generic `INotifyPropertyChanged` implementation that can be used everywhere. – IInspectable Jun 24 '23 at 07:22
  • @IInspectable sorry I'm still not clear whether you are saying that Kenny Kerr can finally write a generic implementation or that I should. Would any idl be involved in this generic implementation? Have you done this? – Tom Huntington Jun 24 '23 at 07:40
  • Also would you be able to bind to this from Xaml? you would need an idl type I believe – Tom Huntington Jun 24 '23 at 08:04
  • 1
    `source_location` allows C++ developers to implement the same functionality as C#' `[CallerMemberName]` attribute. Chances of this implementation making it into C++/WinRT? Less than zero. XAML has long been picking up metastases of the .NET Cancer, with the Windows App SDK finally turned into a .NET-only shit show. You won't see any investments into a system that's been on death row for years. – IInspectable Jun 24 '23 at 10:29

0 Answers0