I completely agree Alan. We have recently been doing something very similar
internally in C++03 and the C++11 primitives are sourly missed. We have
managed to not use std::function by having a certain number of hardcoded
events which can be sent to a connection engine and using custom
promises/futures to retrieve the result.
Overall a lot of complexity is added by reimplementing features which are
available in C++11.

On Fri, Apr 1, 2016 at 5:47 PM, Alan Conway <acon...@redhat.com> wrote:

> I am working on a multi-threaded broker example for proton C++ and I am
> becoming more and more convinced that it doesn't make much sense to try
> to do this without C++11.
>
> There are two classes of issue:
>
> API:
> - inject() needs a way to represent a callback function. Without
> std::function this is very difficult.
> - for memory-safe multi-threaded we will need to expose
> shared_ptr/unique_ptr in the public API (the proton refcounting scheme
> is not thread safe.)
>
> Implementation: initially the multi-threaded broker impl will be
> independent of the single-threaded proton core but at some point we
> will want to provide some thread-safe toolkit as part of the C++ API,
> which internally needs atomics, mutexes etc.
>
> Originally we talked about keeping proton based on C++03. I'd like to
> propose we maintain that for the single-threaded but use C++11 in
> thread-safe and shared_ptr extensions.
>
> If someone wants to add a boost version of those extensions at some
> point that would be fine by me, but I plan to work initially with
> C++11.
>
> Thoughts?
> Alan.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
> For additional commands, e-mail: users-h...@qpid.apache.org
>
>

Reply via email to