[haiku-development]

  • From: Niels Sascha Reedijk <niels.reedijk@xxxxxxxxx>
  • To: Haiku Development <haiku-development@xxxxxxxxxxxxx>
  • Date: Fri, 17 Dec 2021 08:59:36 +0000

Hi all,

I am trying to get some traction on some future netservices again,
after having been very busy with other things (which will last a bit
more until the end of January). In this email I have two changesets
that I would like to get some consensus over first.

https://review.haiku-os.org/c/haiku/+/4479
These macros allow the creation of new APIs that need to build both on
C++11 and on C++98, without the need to duplicate everything in a #if
__cplusplus > 201103L block. The macros should not be applied to
existing APIs, as they will change the signature of functions.

The reason for adding this here, is to allow the conditional use of
new C++ features in changes in the core libs that build on both
platforms, for example to support things on the changeset below.

https://review.haiku-os.org/c/haiku/+/4480
This one is likely to be the more controversial ones. This adds a new
BError type, which is intended to be at the basis of a reach error
hierarchy. Based on previous discussions, it is designed to have a
string representation of the origin, which should help make it easier
to print the errors to logging and to debug applications. The type can
be used as a return type, or as an exception, giving flexibility in
the future.

A point of discussion is whether or not this type should always be
convertible into a status_t. My position is that this is not
necessary: we should use the C++ type system to identify error types,
and not rely on fallible meaningless conversions to an int with a
semantic meaning, but this needs more discussion.

Alternatively, we could consider to put it in a Private namespace if
we feel like it needs to "bake" a bit more, but I am not too sure
about that.

I appreciate thoughts and inputs.

Regards,

N>

Other related posts: