[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 13 02:38:24 PDT 2017


xazax.hun added inline comments.


================
Comment at: clang-tidy/misc/MiscTidyModule.cpp:70
+    CheckFactories.registerCheck<ForwardingReferenceOverloadCheck>(
+        "misc-forwarding-reference-overload");
     CheckFactories.registerCheck<MisplacedConstCheck>("misc-misplaced-const");
----------------
malcolm.parsons wrote:
> aaron.ballman wrote:
> > leanil wrote:
> > > aaron.ballman wrote:
> > > > I wonder if the name might be slightly misleading -- I've always understood these to be universal references rather than forwarding references. I don't have the Meyers book in front of me -- what nomenclature does he use?
> > > > 
> > > > Once we pick the name, we should use it consistently in the source code (like the file name for the check and the check name), the documentation, and the release notes.
> > > Meyers calls them universal references, but it's //forwarding reference// in the standard (14.8.2.1).
> > Hmm, the terms are a bit too new to really get a good idea from google's ngram viewer, but the search result counts are:
> > 
> > Google:
> > "universal reference" : 270,000
> > "forwarding reference" : 9650
> > 
> > Stack Overflow:
> > universal reference : 3016
> > forwarding reference: 1654
> > 
> > So I think that these are probably more well-known as universal references, despite the standard's nomenclature being forwarding reference.
> The Q&A section in https://isocpp.org/files/papers/N4164.pdf explains why "universal reference" is a bad name.
I think in a compiler related project at least in the source code we should stick the the standard's nomenclature. In the documentation, however, it is worth to mention that, this very same thing is called universal reference by Scott Meyers. 


Repository:
  rL LLVM

https://reviews.llvm.org/D30547





More information about the cfe-commits mailing list