yet-another-user / pimpl

The C++ Pimpl Idiom Again!
36 stars 7 forks source link

onstack: verify alignment requirement when constructing a new implementation #9

Closed muggenhor closed 7 years ago

muggenhor commented 7 years ago

This addresses part of #1 by asserting, at construction time, where the impl_type is complete, that the storage alignment is an integer multiple of the constructed type's alignment. This doesn't solve the problem of giving users the option to align at whatever boundary they wish, but at least it prevents one class of undefined behaviour at compile time.