Boost logo

Boost :

Subject: Re: [boost] [function] Placement new warnings from gcc 6
From: Peter Dimov (lists_at_[hidden])
Date: 2016-04-02 08:45:28


Andrey Semashev wrote:

> Thanks. I've made a patch with a similar idea:
>
> https://github.com/boostorg/function/pull/9

This works, although the following alternative:

template<class T> union function_buffer_
{
    // as before
    mutable T data;
};

size_t const function_buffer_size = sizeof(function_buffer_<char>);

typedef function_buffer_<char[function_buffer_size]> function_buffer;

seems slightly more maintainable as it doesn't perform the size computation
separately.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk