C++ initialization is tricky. Check out Abseil's C++ Tips on initialization, which we've published over the past two weeks:
From Tip of the Week #142:
"Prior to C++11, theexplicit
keyword was meaningful only for constructors that could be called with a single argument, and our style guide required its use for such constructors so that they did not act as 'converting constructors.' That requirement was not applied for multi-parameter constructors. Indeed the style guide used to discourage use ofexplicit
for multi-parameter constructors as it had no meaning. That’s no longer the case."
Add a Comment
Comments are closed.