Timeline for Parsing a simple tuple "(float,float,float)" in c++11 iostreams
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 18, 2015 at 23:06 | comment | added | sehe | Yeah. My post was more about finding elegant code, than as a critique. Just mentioned the code as the trigger. (I didn't mention the flaws it has, but I gave them to you in chat :)). And that would be your real question. This question was my own. | |
Jun 18, 2015 at 23:05 | comment | added | CinchBlue | If I may; as I was the one who writes compactcpp, try to keep in mind that at this time, they should only know std::cout and std::cin, and have no concept of the actual stream objects underlying them. "How can I show them how to parse strings in a simple way?" would be the real question. | |
Jun 17, 2015 at 4:49 | answer | added | Loki Astari | timeline score: 3 | |
Jun 17, 2015 at 0:14 | comment | added | psaxton | Neat, it's easy to forget about those kinds of overloads when dealing with languages that are not as open. | |
Jun 16, 2015 at 23:14 | history | edited | sehe | CC BY-SA 3.0 |
added 268 characters in body
|
Jun 16, 2015 at 23:06 | history | edited | sehe | CC BY-SA 3.0 |
deleted 11 characters in body
|
Jun 16, 2015 at 23:02 | history | edited | sehe | CC BY-SA 3.0 |
added 5 characters in body
|
Jun 16, 2015 at 23:02 | history | rollback | sehe |
Rollback to Revision 4
|
|
Jun 16, 2015 at 22:45 | history | edited | Jamal | CC BY-SA 3.0 |
deleted 8 characters in body; edited title; edited tags
|
Jun 16, 2015 at 22:30 | comment | added | sehe |
@psaxton It returns istream& which has a contextual conversion to bool (in c++11¹). The conversion will evaluate to true iff the stream state is good() . [¹ in c++03 it was an implicit conversion to void* ]
|
|
Jun 16, 2015 at 22:27 | comment | added | psaxton |
I'm not terribly well versed in c++, but your code makes me want to pick it up. Question: Won't if (iss >> parsed) always be true since your operator always returns istream is ?
|
|
Jun 16, 2015 at 21:56 | answer | added | Peter | timeline score: 0 | |
Jun 16, 2015 at 21:35 | history | edited | sehe | CC BY-SA 3.0 |
added 103 characters in body
|
Jun 16, 2015 at 21:02 | history | edited | sehe | CC BY-SA 3.0 |
deleted 14 characters in body
|
Jun 16, 2015 at 20:41 | history | edited | sehe | CC BY-SA 3.0 |
added 4 characters in body
|
Jun 16, 2015 at 20:36 | history | asked | sehe | CC BY-SA 3.0 |