[haiku-commits] Re: haiku: hrev48723 - headers/os/support src/kits/network

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 26 Jan 2015 15:44:35 +0100

On 01/26/2015 10:51 AM, pulkomandy@xxxxxxxxxxxxx wrote:
############################################################################

Revision:    hrev48723
Commit:      e9b82428687037c1998e7140661a249710dd93c8
URL:         http://cgit.haiku-os.org/haiku/commit/?id=e9b824286870
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Thu Jan 22 13:36:40 2015 UTC

Add a BConstReference class.

This is a BReference that allows only const access to the referenced
object. This was not easily possible with the existing BReference for
two reasons:
* BReference<const Type> would not work, as BReference needs to change
the reference count of the referenced object. Adding mutable and casting
where appropriate wouldwork but,

Why not provide a specialization for const types instead? It would save the additional class and avoid the fairly ugly implementation.

CU, Ingo


Other related posts: