> On Oct. 15, 2015, 1:47 p.m., Alan Conway wrote:
> > proton-c/bindings/cpp/src/link_options.cpp, line 27
> > <https://reviews.apache.org/r/39222/diff/1/?file=1095257#file1095257line27>
> >
> >     In C++11 we should support the use of vector initializers.
> >     
> >     In C++03 a chaining op() would avoid the arbitrary "only 4" restriction 
> > and multiple constructors:
> >     
> >         link_options& link_options::operator()(const link_option &l) { 
> > push_back(&l); return *this }
> >         
> >         // User code
> >         foo.create_sender(..., link_options(opt0)(opt1)(opt2)(opt3)(opt4))

operator () is a good possibility (boost::program_options uses this). Another, 
probably really bad, idea is to use operator , - I think this is also used in 
some boost libraries to give a nicer syntax.

You'd do the same sort of thing, but it would look much more magic, be less 
robust (you need to get the braces correct, as operator = has a higher 
priority) and generally confuse the hell out of people who didn't know you 
could even overload the comman operator!

It is worht pointing out that in C++11 and on you should strongly prefer the {} 
constructor syntax over the legacy () syntax as it has uniform consistent 
semantics.


- Andrew


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


On Oct. 12, 2015, 6:56 a.m., Cliff Jansen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39222/
> -----------------------------------------------------------
> 
> (Updated Oct. 12, 2015, 6:56 a.m.)
> 
> 
> Review request for qpid, Alan Conway, Andrew Stitcher, and Justin Ross.
> 
> 
> Bugs: PROTON-865
>     https://issues.apache.org/jira/browse/PROTON-865
> 
> 
> Repository: qpid-proton-git
> 
> 
> Description
> -------
> 
> Link options, provided much like the Python client.
> 
> Includes examples from Python for selector and browser.
> 
> Additional link and terminus properties were added as required.
> 
> 
> Diffs
> -----
> 
>   examples/cpp/CMakeLists.txt 34edb83 
>   examples/cpp/queue_browser.cpp PRE-CREATION 
>   examples/cpp/selected_recv.cpp PRE-CREATION 
>   proton-c/bindings/cpp/CMakeLists.txt 45e47b2 
>   proton-c/bindings/cpp/include/proton/connection.hpp 08b6ad9 
>   proton-c/bindings/cpp/include/proton/link.hpp 88b5368 
>   proton-c/bindings/cpp/include/proton/link_options.hpp PRE-CREATION 
>   proton-c/bindings/cpp/include/proton/terminus.hpp 4bb9651 
>   proton-c/bindings/cpp/src/connection.cpp 84c79a6 
>   proton-c/bindings/cpp/src/link.cpp 12c8790 
>   proton-c/bindings/cpp/src/link_options.cpp PRE-CREATION 
>   proton-c/bindings/cpp/src/terminus.cpp 2c960d6 
> 
> Diff: https://reviews.apache.org/r/39222/diff/
> 
> 
> Testing
> -------
> 
> Linux.  Checked attach frames compared to Python.
> 
> 
> Thanks,
> 
> Cliff Jansen
> 
>

Reply via email to