> On Sept. 1, 2015, 9:46 a.m., Joseph Wu wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp, lines 553-555
> > <https://reviews.apache.org/r/37826/diff/3/?file=1061137#file1061137line553>
> >
> >     Can you explain why this is a struct rather than a function?
> 
> Alexander Rukletsov wrote:
>     It's because we cannot partially specialize function templates and 
> overload won't work since we take the same argument. Do you think a comment 
> should be expanded?
> 
> Alexander Rukletsov wrote:
>     http://www.gotw.ca/publications/mill17.htm

Yes, I think a comment would be good regardless of how it ends up.

What about using some C++11 type traits?  (But I'm not sure if this will work.)
Something like:
```
// Specialization for non-repeated fields.
template <typename T>
Try<T> parse(const JSON::Value& value,
    typename std::enable_if<std::is_base_of<T, google::protobuf::Message>, 
int>::type = 0) {...}
```

Note: This file uses some similar Boost type traits further up.


- Joseph


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37826/#review97302
-----------------------------------------------------------


On Sept. 1, 2015, 7:20 a.m., Alexander Rukletsov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37826/
> -----------------------------------------------------------
> 
> (Updated Sept. 1, 2015, 7:20 a.m.)
> 
> 
> Review request for mesos, Joseph Wu and Michael Park.
> 
> 
> Bugs: MESOS-3312
>     https://issues.apache.org/jira/browse/MESOS-3312
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp 
> 57d5fdf45273c620655b44b5f5572290cffa4bf6 
> 
> Diff: https://reviews.apache.org/r/37826/diff/
> 
> 
> Testing
> -------
> 
> make check (Mac OS 10.10.4)
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>

Reply via email to