-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
I think there are couple of issues with
struct EMPTY{}; template<typename ITEM> ITEM* rawMemory(int n = 1) {return (ITEM*)::operator new(sizeof(ITEM) * n);}
- I think aligned new should be used - the correct version doesn't take alignment of Item into consideration. Correct me if I am wrong.
- Not sure - but I think that attempting to use the returned pointer is UB for pretty much everything, including pointer arithmetic. (Not 100% sure, may be this case is covered by implicit-lifetime in C++20 standard), even though it should work in practice on all compilers, as far as I know.
Metadata
Metadata
Assignees
Labels
No labels