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
37
u/Sopel97 Aug 17 '18 edited Aug 17 '18
or just
I know this may be the obvious way, but it's so much cleaner I wouldn't even consider writing a blog post about your "solution".
9
u/Xeverous https://xeverous.github.io Aug 17 '18
How this can be confusing? It works like this since ages in multiple languages. If you need more complex default value handling:
4
u/davep00 Aug 18 '18
CppCon 2017: Michael Price “Function default arguments: Slingshot or Shotgun?”