Details
-
Epic
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.3.0
-
Core: Animation Framework, Core: Containers and Algorithms, Core: Date/Time, Core: Event loop, Core: Filesystem watching, Core: I/O, Core: Item Models, Core: Locales (i18n), Core: Object Model, Core: Other, Core: Plugins, Core: QString and Unicode, Core: QtConcurrent, Core: Resource System, Core: State Machine, Core: Threads, Core: URL Handling, Network
-
None
-
Expensive default arguments
-
-
14fe0bbea (dev), bc99032f9 (6.4), 1dc04109d (6.5), 8134b35f2 (tqtc/lts-5.15), 6af0a4c31 (tqtc/lts-6.2), 71d9ebfb1 (dev), dacc75de2 (6.6), 3adf81f09 (dev), a44a81ceb (6.6)
Description
Default arguments are a convenient way to avoid overloads, but if the defaulted argument isn't a Trivial Type, and a common use case is to not pass the extra argument explicitly, the construction of the temporary can dominate the call's runtime. It certainly causes useless code being emitted at the call site.
Therefore, check all of our APIs for non-trivial default arguments and consider replacing them with overloads.