Skip to main content

Timeline for Console Library System in C++

Current License: CC BY-SA 4.0

10 events
when toggle format what by license comment
Dec 15, 2021 at 3:38 comment added Pham Long @JDługosz Thank you. I read some opinions and got the idea of it.
Dec 14, 2021 at 15:49 comment added JDługosz @PhamLong Why brace initialization is better: You can find videos on YouTube from major conventions (CPPCON comes to mind) from 2010/2011 that explain "Uniform Initialization" in detail, and the motivations. There's like an hour-long presentation on that.
Dec 14, 2021 at 15:46 comment added JDługosz @PhamLong Most of the time, you don't explicitly check the results. Rather, a function does what you told it to or it doesn't return normally at all. I/O is different, since you can have environmental errors rather than just bugs in your code. The functions like opening a file provide for not succeeding, and communicating back status information.
Dec 13, 2021 at 18:34 comment added Pham Long @Ritualmaster I mean the IO operations should be based on the result of the action before it (in this case, pushing an object to the vector) but idk how to check that because push_back is a void function. About the IO streams, you're absolutely correct. I should have used them only for files input output, and should have had separate read and print functions for console outputting. Thank you for the wise words.
Dec 13, 2021 at 16:51 history edited Winters0x168 CC BY-SA 4.0
edited body
Dec 13, 2021 at 9:55 comment added Ritualmaster Vector push_back is not considered IO, it is rather in-memory handling of a container. For IO you will most likely use open, close, write, read or c++ streams to files/devices. But you can enable exceptions for streams. For a user executable it is better to convert it to a readable error expression for a library user it may be a custom one or the one thrown. If you need to convert it to anyway, you can just check the return codes.
Dec 13, 2021 at 3:46 comment added Winters0x168 Sure, you can get a detailed view here
Dec 13, 2021 at 2:31 comment added Pham Long Some of the IO-operations I have no clue how to check (like vector push_back function for example) but I'll note that. Can you explain why is the brace initialization is better? Thank you
S Dec 13, 2021 at 2:20 review First answers
Dec 13, 2021 at 11:45
S Dec 13, 2021 at 2:20 history answered Winters0x168 CC BY-SA 4.0