You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On page 193, you introduce the placement operators. Specifically, you demonstrate how to use new operator and provide the function signature as void* operator new(size_t, void*). However, when use of the function is demonstrated it is demonstrated as:
auto point1 = new(&data[0 * point_size]) Point{};
auto point2 = new(&data[1 * point_size]) Point{};
auto point3 = new(&data[2 * point_size]) Point{};
The provided signature is not consistent with the demonstrated use. Specifically, there is no size_t passed in as an argument as the function signature stipulates there should. This was confusing. Why is there no size_t passed in when the function is called? Is it optional? I ran the code, and it compiles without issues or warning, but the book does not explain what is going on here, nor even acknowledge the inconsistency. As a book that is teaching the language and assumes no prior knowledge with c++, this seems like an oversight.
In any case, I am enjoying the book so far. I just wanted to point this out.
The text was updated successfully, but these errors were encountered:
On page 193, you introduce the placement operators. Specifically, you demonstrate how to use
new
operator and provide the function signature asvoid* operator new(size_t, void*)
. However, when use of the function is demonstrated it is demonstrated as:The provided signature is not consistent with the demonstrated use. Specifically, there is no
size_t
passed in as an argument as the function signature stipulates there should. This was confusing. Why is there nosize_t
passed in when the function is called? Is it optional? I ran the code, and it compiles without issues or warning, but the book does not explain what is going on here, nor even acknowledge the inconsistency. As a book that is teaching the language and assumes no prior knowledge with c++, this seems like an oversight.In any case, I am enjoying the book so far. I just wanted to point this out.
The text was updated successfully, but these errors were encountered: