> On Feb. 2, 2016, 7:54 p.m., Vinod Kone wrote:
> > src/master/master.cpp, line 1801
> > <https://reviews.apache.org/r/43075/diff/1/?file=1228851#file1228851line1801>
> >
> >     The output stream operator overload for Call (unversioned) defined in 
> > "mesos/scheduler/scheduler.hpp". Not sure why the compiler unable to find 
> > that overload (defined in `mesos` namespace).
> >     
> >     It seems to work fine for log statements (that print v1::Call) in 
> > scheduler.cpp. The overload for v1::Call was defined in 
> > "mesos/include/mesos/v1/scheduler/scheduler.cpp" though, which is in the 
> > same namespace as the log statements in scheduler.cpp.

I _believe_ what is going on here is that the overload of `operator<<` for 
`mesos::scheduler::Call::Type` is defined in the `mesos` namespace, not the 
`mesos::scheduler` namespace. Since ADL only considers the "closest enclosing 
namespace" of the argument (see http://en.cppreference.com/w/cpp/language/adl , 
case 2(d)), it looks for an overload in `mesos::scheduler` but not `mesos`.

Defining the overload of `operator<<` in `mesos::scheduler` seems to fix the 
problem. I think it is generally good practice to group types and functions on 
those types together into the same namespace, anyway. I'll submit a revised RR 
doing that shortly.


- Neil


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


On Feb. 2, 2016, 5:12 a.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43075/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2016, 5:12 a.m.)
> 
> 
> Review request for mesos and Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Old output: "Dropping 2 call from framework ..."
> 
> New output: "Dropping TEARDOWN call from framework ..."
> 
> 
> Diffs
> -----
> 
>   src/master/master.cpp 98441a543611d4083b2495ee103f0ab5e2187e83 
> 
> Diff: https://reviews.apache.org/r/43075/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Neil Conway
> 
>

Reply via email to