> On Dec. 22, 2015, 4:52 a.m., Benjamin Hindman wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/jsonify.hpp, line 84
> > <https://reviews.apache.org/r/41593/diff/2/?file=1173648#file1173648line84>
> >
> >     Did you mean to mark this a friend? Is this supposed to be static? Is 
> > this function even used?
> 
> Michael Park wrote:
>     Yes, this is intended to be a `friend` because it accesses `write_` which 
> is marked `private`. Currently it's used by `operator std::string()` but with 
> the above changes that could no longer be true. Regardless though, it would 
> be used by expressions such as `std::cout << jsonify(true);`.
>     
>     We could use perhaps a more familiar(?) pattern:
>     
>     ```cpp
>     struct Proxy {
>     
>       /* ... */
>       
>       friend std::ostream& operator<<(std::ostream& stream, Proxy&& that);
>     };
>     
>     std::ostream& operator<<(std::ostream& stream, Proxy&& that) {
>       that.write_(&stream);
>       return stream;
>     }
>     ```

Used the more familiar pattern.


- Michael


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


On Jan. 4, 2016, 7:28 p.m., Michael Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41593/
> -----------------------------------------------------------
> 
> (Updated Jan. 4, 2016, 7:28 p.m.)
> 
> 
> Review request for mesos and Benjamin Hindman.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/README.md 
> a2a3dc6120b10c8fe82088b9f0ebecfa5642f945 
>   3rdparty/libprocess/3rdparty/stout/include/Makefile.am 
> b2dea9b93adfa3ea0415a0b5c81a369dd29b6cfe 
>   3rdparty/libprocess/3rdparty/stout/include/stout/jsonify.hpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/41593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Michael Park
> 
>

Reply via email to