update documentation for custom serialization and reader.read() template

Issue #439 resolved
Rob Egan created an issue

In trying to follow the example to write a customized serialization struct, the upcxx-spec documentation on page 51 states:

template <typename Reader >
17 static UserType* deserialize(Reader& reader, void* storage) {
18 // Order of these matters, which is why they can’t be done
19 // inline in the constructor call below (argument-evaluation
20 // order is unspecified in C++).
21 U a = reader.read<U>();
22 W c = reader.read<W>();
...

but I was getting compiler errors like:

error: expected primary-expression before > token

After googling this kind of error, I found that, for gcc 7.5, I had to use the equivalent of the following to get it to compile.

U a = reader.template read<U>();
W c = reader.template read<W>();

Comments (2)

  1. Log in to comment