On Mon, Oct 2, 2017 at 12:19 PM David Kimura <dkim...@pivotal.io> wrote:
> The other question though is, could function overload resolution be a valid > use case for out variables (particularly in PdxReader, for example)? I am against exceptions to rules unless the exception is more readable. In this case I don't think the exception to our rule, of using return values only and no out params, gains anything for single return types that differ. auto i = input.readInt(); auto b = input.readByte(); Is more expressive and readable than: int i; input.read(i); char b; input.readByte(b); Templates could solve the problem, but I am not sure it is more expressive or easier to read: auto i = input.read<int32_t>(); auto b = input.read<int16_t>(); It also runs into issues of ballooning specializations for each of the C++ types. See: http://coliru.stacked-crooked.com/a/33ca43ee0ed59a7f <http://coliru.stacked-crooked.com/a/be6ef60194d4e0db> I think in this case since the serializer is dealing with our "GemFire Types" which just happen to be Java types then we should be descriptive in those terms therefor readInt, readLong, readShort, etc. wins in my book. -Jake