
On Wednesday 01 August 2012 20:36:03 Daniel Larimer wrote:
One of the things I realized doing this work was that often the only reason you need to include a header is because the compiler needs to know the SIZE of the type that you wish to forward declare and nothing else. So our development is slowed entirely due to the lack of a SINGLE NUMBER. So I created a utility that allowed me to 'forward declare' the size of the variable. This allowed me to use return by value and member variables via forward declaration WITHOUT having to resort to heap allocation.
This is an interesting idea but you also have to know alignment of the forwarded type. Which basically brings us to aligned_storage. I think, a simple wrapper around aligned_storage like your fwd could be a useful tool.