Talk:Rule of three (C++ programming)
This is the talk page for discussing improvements to the Rule of three (C++ programming) 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 has not yet been rated on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
Please add the quality rating to the {{WikiProject banner shell}} template instead of this project banner. See WP:PIQA for details.
|
Disambiguation
- One of the references says Op. cit. - but which of the two others is meant?
- copy assignment operator = copy constructor?
--Abdull (talk) 23:24, 29 February 2008 (UTC)
- I've attempted to WP:DAB the citation and I've updated Assignment operator in C++ to distinguish it from the copy constructor. -- DanielPenfield (talk) 19:03, 2 March 2008 (UTC)
Singleton?
In my opinion the singleton design pattern isn't relevant here, the rule of three is meant to prevent bugs of oversight and not enforcing semantics (such as "only one" singleton).
Additionally as far as I know a private destructor is not part of the singleton pattern. Motti (talk) 19:34, 7 September 2009 (UTC)
- Agreed. It's two separate (but related) concepts. What they have in common is that they represent two situations where the implicitly generated special member functions are undesired, but for different reasons. decltype (talk) 09:36, 8 September 2009 (UTC)
Marshall Cline
Please consider discussing the linking of Marshall Cline instead of edit-warring. decltype
(talk) 13:56, 29 June 2010 (UTC)
- What is the point of linking to a non-existent entry? It adds absolutely nothing to anyone reading this entry. Once there is a Marshall Cline entry by all means link to it but until it exists a dead link is only distracting. Motti (talk) 10:47, 30 June 2010 (UTC)
- The relevant guideline is WP:RED. In short, a red link is usually appropriate if the target is a notable subject in its own right. The question then becomes whether Cline is notable. I think he may be, but I'd say it's a borderline case. For this reason I did not link when I initially added the info to the article.
decltype
(talk) 11:06, 30 June 2010 (UTC)
- The relevant guideline is WP:RED. In short, a red link is usually appropriate if the target is a notable subject in its own right. The question then becomes whether Cline is notable. I think he may be, but I'd say it's a borderline case. For this reason I did not link when I initially added the info to the article.
- From what I can see in a quick search Mr. Cline wrote the C++ FAQ Lite (and one book called C++ FAQs), this doesn't appear to be enough to be note worthy. Motti (talk) 08:07, 1 July 2010 (UTC)
- Over a year later this is still a red link, I will unlink in accordance to Red links to personal names should be avoided. Motti (talk) 06:44, 28 November 2011 (UTC)
Rule of three becomes rule of five in C++0x
In addition to the already-mentioned operators, there is also the move constructor and the move assignment operator. (http://stackoverflow.com/questions/4782757/rule-of-three-becomes-rule-of-five-with-c11) I think this should be mentioned in the article. 136.186.217.27 (talk) 05:45, 22 January 2013 (UTC)
Example not an example
Unless I'm missing something, the example code doesn't define an assignment operator... so it's not a good example for the Rule of three that this article is about! -- pne (talk) 12:09, 7 February 2013 (UTC)
- Awesome call. I think I've fixed it! Pixor (talk) 02:13, 8 February 2013 (UTC)
This example doesn't cater well to programmers without an extensive knowledge of C++. Perhaps I'm an idiot and just haven't immersed myself in "standard" c++ example code, but the syntax here is woefully confusing, and I've been coding in this language for a while now. A simpler example might help others understand what's going on here. Ryantuck (talk) 22:38, 11 February 2013 (UTC)
The example is also wrong. The assign operator invalidates the "other" object due to the idiotic swap that is most likely supposed to be the copy-swap-idion (but isn't). 194.156.172.203 (talk) 09:02, 11 March 2013 (UTC)