When working with Windows Runtime objects, you should avoid the coding pattern shown below because it can have a negative impact on your application by causing more binary code than necessary to be generated.
anobject.b().c().d();
anobject.b().c().e();
anobject.b().c().f();
In the Windows Runtime world, the compiler is unable to cache either the value of c() or the interfaces for each method that's called through an indirection ('.'). Unless you intervene, that results in more virtual calls and reference counting overhead. The pattern above could easily generate twice as much code as strictly needed. Instead, prefer the pattern shown below wherever you can. It generates a lot less code, and it can also dramatically improve your run time performance.
auto a{ anobject.b().c() };
a.d();
a.e();
a.f();
The recommended pattern shown above applies not just to C++/WinRT but to all Windows Runtime language projections.