This is the talk page for discussing improvements to the Placement syntax article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
![]() | This article is rated B-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||
|
![]() | Placement syntax was a Engineering and technology good articles nominee, but did not meet the good article criteria at the time. There may be suggestions below for improving the article. Once these issues have been addressed, the article can be renominated. Editors may also seek a reassessment of the decision if they believe there was a mistake. | ||||||||||||
| |||||||||||||
Current status: Former good article nominee |
An article on placement new is neccesary to support the article New_(C++). Before this placement new article, that "new" article was incomplete and inaccurate - for example in stating that "new" always allocated memory and that objects created by "new" were always on the heap.
Originally, I tried to have this article mirror the "new" article - and it was suggested that it be deleted because it was too much "how to". It has since been editted by myself and another (thank you Hans Adler) and is more descriptive with very little "how to" remaining. Scott Bowden (talk) 01:47, 25 November 2008 (UTC)
The deallocation example sourced to Vermeir is wrong. The destructor should be explicitly called as well. But it's what the source says. Uncle G (talk) 21:46, 26 November 2008 (UTC)
Despite not having contributed significantly to the article, I have nominated it for GA, as I believe it to be of reasonable quality and feel comfortable with handling any issues that may come up at the review. decltype (talk) 08:59, 9 October 2009 (UTC)
A great page overall, but I think coverage of array allocation is not very good.
new[]
at all, yet the Function section refers to array new
expressions, as if the reader already knew what they were.new[]
expression may return a different value from what the new[]
function returned, so there is no way to deallocate the array when there is no delete
expression.Chris D Heath (talk) 18:40, 26 August 2010 (UTC)
User:Uncle G noted that reference to third edition of Stroustrup's 'The C++ Programming Language' (in History section) doesn't contain information that certain technique is not mentioned there. IMHO it is an interesting case: on one hand, it is possible to argue that the book itself contains enough information that certain thing is not mentioned (it is verifiable); on the other hand, it is possible to argue that this fact itself qualifies as WP:OR. IMHO, it can be relatively easy argued both ways, therefore the question: are there any guidelines on this relatively subtle case? IMHO, mentioning that this technique is deprecated/abolished is relevant to the article (and the fact that it has been mentioned in 2nd edition of the most important book on C++ and has been dropped in 3rd edition is relevant too), but what proof can be potentially provided for something not being mentioned? Ipsign (talk) 11:05, 27 October 2010 (UTC)
this
was not synchronized to edition numbers of TCPPPL. Uncle G (talk) 12:50, 27 October 2010 (UTC)
While I cannot provide references right away, I know where to look for them, which might be useful for improving the article: in MSVC++ v1.5 placement new was not supported, in MSVC++ v4.0 it was supported for sure; GCC has had similar timing, though I don't know exact version numbers. I'm sure relevant references can be easily found in appropriate manuals, unfortunately, I currently don't have access to them. Ipsign (talk) 11:13, 27 October 2010 (UTC)
This is not the case of notable historic material. All compilers had flaky C++ support at some time and all compilers have had some compiler specific extensions. However, this g++ syntax was not feature, but a bug, due to that this syntax was not alternative, but a replacement for the one mandated by the standard (and not used at all also). So I consider this almost perfect example of WP:CHERRY.
Is that supported? i.e. create a 'const uint32_t' on a (properly alignend) read-only memory position that is denoted by a 'const char*' or 'const void*' pointer? --RokerHRO (talk) 14:22, 17 August 2011 (UTC)
reinterpret_cast<…>
. :-/ --RokerHRO (talk) 10:43, 24 August 2011 (UTC)Can somebody explain the following text: "For both the new and the delete functions, the functions are global, are not in any namespace, and do not have static linkage."
I assume that the intention was to say that the new-function resides in libstdc++, and thus is typically linked at run time. However, the standard library *can* be linked statically afaik. I don't think that linkage options is specified in the language, so it seems a bit strange to include on a language page. Furthermore, most people reading this page will compare with the regular new syntax, so I interpret all information "as opposed to regular new" unless stated otherwise. — Preceding unsigned comment added by 81.233.172.137 (talk) 12:26, 23 November 2013 (UTC)
Modern versions of the C++ standard have added sized dealocator, used automatically by the compiler when the type size of a delete is known at compile time. This conflicts to some extent with placement dealocator as it reserves some declarations. — Preceding unsigned comment added by 31.53.220.42 (talk) 17:27, 28 July 2016 (UTC)