Boost logo

Boost :

From: Marcelo Zimbres Silva (mzimbres_at_[hidden])
Date: 2024-10-20 19:15:31


On Sun, 20 Oct 2024 at 20:32, Vinnie Falco <vinnie.falco_at_[hidden]> wrote:

I don't like configuration macros. Because these create different
> libraries, effectively creating separate object files which have the
> potential to be incompatible at link-time. It is simpler for there to be
> only one version of the library with no configurations.

Yes, it is bad and won't work for a library that has to be compiled (and I
hope this will be one of the conditions imposed if this lib gets accepted).
But IMO even that is better than letting users with no clue about what is
happening. To the bare minimum I would log, resolving, connecting,
handshaking, reading and writing, for example

log("resolving");
obj.async_resolve(...)
if (ec) {
   log("resolve failt with:" , ec);
   return;
}

> our goal is to find a more elegant, C++-style solution that achieves the
same effect.
>
> <snip>

This is the approach I took in Boost.Redis:
https://www.boost.org/doc/libs/1_86_0/libs/redis/doc/html/classboost_1_1redis_1_1basic__connection.html#ae548b1dd13ca66eb265d3e5115ebe3e5

The template parameter is an annoyance to deal with in type-erased
connection types where a definite type is required. It is also questionable
to pollute the public API with log types just because we are too afraid of
upsetting users by logging into a global state. We have a log library in
Boost so why not default to it?

Marcelo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk