[libcamera-devel] [PATCH 4/4] libcamera: camera: Handle camera objects through shared pointers

Jacopo Mondi jacopo at jmondi.org
Fri Jan 18 18:05:51 CET 2019


Hi Laurent,

On Fri, Jan 18, 2019 at 06:47:22PM +0200, Laurent Pinchart wrote:
> Hi Jacopo,
>
> On Fri, Jan 18, 2019 at 04:39:56PM +0100, Jacopo Mondi wrote:

[snip]

> > > +	struct Allocator : std::allocator<Camera> {
> >
> > out of curiosity, why a struct and not a class?
>
> No reason, I think I found this in sample code somewhere. Should I make
> it a class ?
>

Not really if there is not requirement to do so.


> > > +		void construct(void *p, const std::string &name)
> > > +		{
> > > +			::new(p) Camera(name);
> >
> > This "new(p)" scares me :)
>
> Shhhhhh... :-)
>

There will be one day where I could say "I finally got C++" and not be
prove wrong a few minutes after.

Thanks
  j

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20190118/bc466b49/attachment.sig>


More information about the libcamera-devel mailing list