4 ms·
This is an interesting question! I've come across the thought myself from time to time... usually have to end up creating objects/structs to then return, thoug
by cclogg 13y ago
This is an interesting question!
I've come across the thought myself from time to time... usually have to end up creating objects/structs to then return, though in the past when I've been lazy (on iOS) I've chunked things into NSArray/NSDictionary.
But darn, I can't remember specific examples right now, I know I've definitely had moments where returning multiple things would have been nice lol.
- krapp 13y agoI've found returning type and boolean useful more than once, usually 'data of type and false if something went wrong or the return data is invalid, data of type and true if valid.' std::pair<T, boolean> was like a gift from the gods when I found out about it