C++相談室 part110
■ このスレッドは過去ログ倉庫に格納されています
0169デフォルトの名無しさん
2014/01/17(金) 01:25:57.45c が hoge 用にアラインされてないと動作は保障されない。
alignas(hoge) char c[sizeof hoge] なら、大丈夫。
配列 new でもないので、 b は常に真。
5.3.4 [expr.new] p14
> [ Note: when the allocation function returns a value other than null, it
> must be a pointer to a block of storage in which space for the object
> has been reserved. The block of storage is assumed to be appropriately
> aligned and of the requested size. The address of the created object
> will not necessarily be the same as that of the block if the object is
> an array. -end note ]
■ このスレッドは過去ログ倉庫に格納されています