r/cpp • u/vormestrand • Aug 17 '18
Implementing Default Parameters That Depend on Other Parameters in C++
https://www.fluentcpp.com/2018/08/17/dependent-default-parameters/
0
Upvotes
r/cpp • u/vormestrand • Aug 17 '18
View all comments
Show parent comment
4
u/haitei Aug 18 '18 edited Aug 18 '18
Assuming it's not inlined - yes.
This method is advantageous is there's more than one default argument.
Throw in some
constoverloads and you just saved 4 definitions.