Boost logo

Boost :

From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2021-09-13 10:05:36

On Fri, Aug 20, 2021, 14:24 Viktor Sehr via Boost <boost_at_[hidden]>

> I just discovered basic_any which is a very nice addition for me. However
> it's a bit under-documented for the moment.

Thanks! Glad to hear that.

It's quite hard to write a good docs, I'd appreciate help. Feel free to
provide PRs to adjust the docs

> For example:
> - I assume it's stack-allocated, does it allocate on the heap if assigned
> an object larger than the stack (like small_vector) or is this not allowed
> (like static_vector)?

Yes, it allocates on the heap if the object does not fit. It's documented
here, somewhere between the lines

- An idea would also be to add a flag which breaks compilation if an object
> larger than the OptimizeForSize argument is assigned?

Good idea. Please fill a feature request

- (For detail) If allocated on the stack, are the first bytes of the
> basic_any the same as the contained object?

No. For what were you planning to rely on that?

> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at