[libcamera-devel] [PATCH] FrameBufferAllocator: fix non-copyability
Tomi Valkeinen
tomi.valkeinen at iki.fi
Fri Sep 25 16:18:36 CEST 2020
On 25/09/2020 17:15, Kieran Bingham wrote:
> Hi Tomi, Laurent,
>
> On 25/09/2020 15:07, Laurent Pinchart wrote:
>> Hi Tomi,
>>
>> Thank you for the patch.
>>
>> On Fri, Sep 25, 2020 at 05:05:25PM +0300, Tomi Valkeinen wrote:
>>> FrameBufferAllocator is supposed to delete copy constructor and
>>> copy-assignment operator. It doesn't do that as it uses Camera as a
>>> parameter instead of FrameBufferAllocator.
>>
>> Oops... Good catch.
>>
>> It's a shame we can't have unit tests whose compilation failure would
>> indicate success, to catch issues like these.
>
> Should we perhaps make use of a macro to ensure this doesn't happen?
> something akin to the Chromium DISALLOW_COPY_AND_ASSIGN type macros?
>
> (Though, deleting them, rather than making them private).
Probably also a base class can do this:
https://www.boost.org/doc/libs/1_65_0/libs/core/doc/html/core/noncopyable.html
Tomi
More information about the libcamera-devel
mailing list