Just curious is there any technical limitation in having multiple return values for methods in languages like java, c, c++ or limitation is just by spec? In assembly language I understand callee can pop one value to register.
Just curious is there any technical limitation in having multiple return values for methods
Share
struct, reference (in Java/C#), or pointer.Allowing multiple return values would add complexity, and it’s simply worked around. There’s no reason for it to be there. (Indeed, in C++ you can return a
tuple(from TR1, C++11, or boost) which effectively is multiple return values)