Timeline for Python-style Keyword Args in C++ - good practice or bad idea?
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 4, 2021 at 3:29 | comment | added | John Jiang | @Tuntable I agree all of these c++ ways are super ugly and inconvenient. | |
Mar 26, 2019 at 7:40 | comment | added | Tuntable | Nice answer. But it does beg the question as to why after all these years C++ still cannot do this. Particularly for bools. foo(happy:=true, fast:=false) is much easier to follow than foo(true, false). (Using Visual Basic notation here!). | |
Aug 16, 2018 at 4:57 | comment | added | jwenting | another problem that comes to mind is that the code is a lot harder to read and comprehend for experienced C++ programmers than normal code. I've worked on a program where someone had thought it a good idea to do something like #define PROCEDURE void #define BEGIN { #define END } etc. etc. because he wanted to make C look like Pascal. Say again? | |
Nov 20, 2017 at 1:42 | comment | added | svenevs | That makes sense :) | |
Nov 19, 2017 at 16:28 | comment | added | An Owl |
@sjm324, thanks. Because struct foo is a throw-away object just to mimic the original Python function syntax; passing name-values in one line at the call site. They could be public but that just wasn't the point here.
|
|
Sep 21, 2017 at 23:10 | comment | added | svenevs |
Great answer! Out of curiosity, for approach 2, why are the internal variables private ? Making them public means they can either call the function or set the variable directly.
|
|
Sep 4, 2016 at 3:03 | review | First posts | |||
Sep 29, 2016 at 19:52 | |||||
Aug 31, 2016 at 8:06 | history | edited | manlio | CC BY-SA 3.0 |
added 2 characters in body
|
Aug 30, 2016 at 20:37 | history | edited | An Owl | CC BY-SA 3.0 |
Chained setter boilerplate remedy
|
Aug 30, 2016 at 20:02 | history | edited | An Owl | CC BY-SA 3.0 |
Remove example source, rosetta took it from boost.
|
Aug 30, 2016 at 19:50 | history | answered | An Owl | CC BY-SA 3.0 |