Talk:Barton–Nackman trick: Difference between revisions
→What is achieved?: new section |
→friendly access yet still public: new section |
||
Line 21: | Line 21: | ||
The article mentions that template overloading is not a problem anymore. So when and why would I use this trick nowadays? What can be achieved that can't be done by just writing free template functions? Would like to see an example here. |
The article mentions that template overloading is not a problem anymore. So when and why would I use this trick nowadays? What can be achieved that can't be done by just writing free template functions? Would like to see an example here. |
||
[[Special:Contributions/84.245.149.53|84.245.149.53]] ([[User talk:84.245.149.53|talk]]) 10:25, 12 January 2016 (UTC) |
[[Special:Contributions/84.245.149.53|84.245.149.53]] ([[User talk:84.245.149.53|talk]]) 10:25, 12 January 2016 (UTC) |
||
== friendly access yet still public == |
|||
bool equal_to(value_type const& rhs) const; is a public function. There is no explanation why this is (and has to be) a public function when called by the friend function, when friend functions are supposed to be able to access private functions. [[User:QuentinUK|QuentinUK]] ([[User talk:QuentinUK|talk]]) 15:47, 22 May 2016 (UTC) |
Revision as of 15:47, 22 May 2016
This is the talk page for discussing improvements to the Barton–Nackman trick 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 |
Archives: 1 |
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.
|
Note for editors
I saw that this article has been discussed at the following Google Groups thread. (If that link goes dead, search for a thread entitled "How to fix a program that depends on friend injection?" that began on March 11 2007). Note that at one time this article depended on information in Vandevoorde and Josuttis. David himself has edited this article to reflect that the book was slightly incorrect with respect to function template overloading (and noted that he had in the thread mentioned). Given all this, I ask future editors to be particularly careful to not inadvertedly re-introduce mistakes that have been corrected. Many thanks, Pcb21 Pete 09:40, 14 March 2007 (UTC)
- I think we should add this note as a comment, to make sure anyone attempting to edit the article will see it. I'd expect a correction to be posted in reasonable time on the book errata, since David kindly forwarded a note to Nicolai, who maintains the errata page. When that will happen, we can change that comment to something like "note: see errata at http://... etc. etc." —Gennaro Prota•Talk 08:23, 17 March 2007 (UTC)
Proposal mistake
The proposal that is intended to "obsolete" the barton & nackman trick actually talks about the idiom Curiously Recurring Template Pattern (which concepts indeed declare obsolete then), even though it claims talking about the Barton & Nackman trick. I believe it confuses these two concepts.
As explained in the article, this is confused often. But as this is a link to a more or less official document containing this confusion, i will not remove that link from the article, but rather ask you what to do about it. —Preceding unsigned comment added by 84.174.239.213 (talk) 07:14, 20 May 2009 (UTC)
What is achieved?
The article mentions that template overloading is not a problem anymore. So when and why would I use this trick nowadays? What can be achieved that can't be done by just writing free template functions? Would like to see an example here. 84.245.149.53 (talk) 10:25, 12 January 2016 (UTC)
friendly access yet still public
bool equal_to(value_type const& rhs) const; is a public function. There is no explanation why this is (and has to be) a public function when called by the friend function, when friend functions are supposed to be able to access private functions. QuentinUK (talk) 15:47, 22 May 2016 (UTC)