geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Barrett <>
Subject Re: [DISCUSS] Using out parameters and its effects on function overload resolution
Date Mon, 02 Oct 2017 19:51:07 GMT
On Mon, Oct 2, 2017 at 12:19 PM David Kimura <> 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;;
char b;

Templates could solve the problem, but I am not sure it is more expressive
or easier to read:

auto i =<int32_t>();
auto b =<int16_t>();

It also runs into issues of ballooning specializations for each of the C++
types. See:

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.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message