All, as stated in the review request below, I propose that we update our C++ style guide to explicitly allow “auto” for shared pointer creations.
I suggest that any similar situation should be included. In general, if the exact same type that would be written on the left is already fully expressed on the right, then we should be allowed to use auto. Would you like me to give it a try to define this in the docs as well? Or would you rather prefer just the one-off example I posted in the review? Bernd > On Feb 9, 2015, at 11:30 AM, Bernd Mathiske <[email protected]> wrote: > > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/30792/ > ----------------------------------------------------------- > > Review request for mesos. > > > Repository: mesos > > > Description > ------- > > Explicitly allows auto declarations for shared pointer creations. Example: > > auto nameList = make_shared<list<string>>(); > > Here the type on the left is already explicitly stated on the right. This > replaces > > shared_ptr<list<string>> nameList = make_shared<list<string>>(); > > where we needlessly write the same type twice. > > > Diffs > ----- > > docs/mesos-c++-style-guide.md b24fe4b64a2577060f66ef49ae8b5d4a9d94167c > > Diff: https://reviews.apache.org/r/30792/diff/ > > > Testing > ------- > > None. This is doc text only. > > > Thanks, > > Bernd Mathiske >
