Skip to main content

Timeline for Templated string formatting

Current License: CC BY-SA 4.0

15 events
when toggle format what by license comment
Oct 3, 2018 at 3:02 history tweeted twitter.com/StackCodeReview/status/1047320931490836480
Sep 30, 2018 at 13:08 answer added user673679 timeline score: 3
Sep 29, 2018 at 2:17 answer added user52292 timeline score: 3
Sep 29, 2018 at 0:41 comment added lelgetrekt Right, didn't think of that. Maybe I should get some sleep :) Btw, I like your approach. It does a lot more than I need in this particular case but definitely very interesting.
Sep 29, 2018 at 0:39 comment added user52292 Well, get for the tuple gets the index as template-parameter, not as argument, so no, you would need something a bit different (either something like my data pack or array of wrappers... too complicated I guess, the vector is fine after all).
Sep 29, 2018 at 0:36 comment added lelgetrekt I see. A tuple is probably a better solution since I wouldn’t need the to_string_vector function at all then.
Sep 29, 2018 at 0:20 comment added user52292 As for the vector, well, such solution could be too advanced for you (e.g. capturing the arguments in a tuple). You can take a look at my own attempt (quite a different level).
Sep 29, 2018 at 0:14 comment added user52292 At least after } and before { when there is something else after/before: } else { and if(fmt[second] == '}') {, maybe after keywords (if (... and for () but that would be bonus :)
S Sep 29, 2018 at 0:11 history suggested chicks CC BY-SA 4.0
formatting
Sep 29, 2018 at 0:09 comment added lelgetrekt @firda Thanks for the feedback. I’m not a big fan of too many whitespaces. I find them more annoying than helpful. Where would you suggest I add some more? I’m using the vector so that I can directly use the parsed index to look up the value. Not sure how I could do this directly with ostream.
Sep 28, 2018 at 23:53 comment added user52292 The code could use some prettification (whitespaces) and you could possibly avoid creating the vector of strings by working directly with ostream, but it works and looks ok. Any concerns and/or future plans?
Sep 28, 2018 at 23:50 review Suggested edits
S Sep 29, 2018 at 0:11
Sep 28, 2018 at 21:37 history edited lelgetrekt CC BY-SA 4.0
added 98 characters in body
Sep 28, 2018 at 21:10 review First posts
Sep 28, 2018 at 23:50
Sep 28, 2018 at 21:05 history asked lelgetrekt CC BY-SA 4.0