Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 3
    In this context they are identical, and the first one is preferred. Commented Oct 22, 2018 at 20:34
  • Why is the first one preferred? Commented Oct 22, 2018 at 20:35
  • Because there is no pointless repetition. Commented Oct 22, 2018 at 20:35
  • 2
    Makes sence. You say 'in this context they are identical'. In what context will they NOT be identical? Because it's weird that there are 2 ways of making an object if they are identical Commented Oct 22, 2018 at 20:36
  • 1
    One difference is that the second form requires a copy constructor pre-C++17. See stackoverflow.com/questions/1051379/…. Commented Oct 22, 2018 at 20:38