News for hackers. Stuff that matters.
Re:The C++14 Standard: What You Need to Know by ubercore on Wednesday September 17, 2014 @09:57AM (#8329936)
No, the return type can change as long as all return paths return the same value for the same function call. So you can't, in the same execution, return two different types, but two different executions can vary their return type as long as its consistent.
Re:The C++14 Standard: What You Need to Know by pyrois on Wednesday September 17, 2014 @10:12AM (#8330035)
The point is that -1 is not a GUID, though, so in the sample function, if record::id changes to a GUID, the find_id function is now trying to return -1 (an integer) and ii->id (a GUID).
Re:The C++14 Standard: What You Need to Know by ubercore on Wednesday September 17, 2014 @10:48AM (#8330240)
Right. Thanks for correcting me, I missed that.