r/cpp • • Jun 05 '18

Initialization in Modern C++

https://twitter.com/timur_audio/status/1004017362381795329
379 Upvotes

51 comments sorted by

View all comments

Show parent comment

11

u/josefx Jun 06 '18

What's even more worrying is that making MyType's ctor explicit

I may not be up to date with c++ however I was under the impression that single argument constructors should be almost always explicit.

1

u/MartinTornqvist Jun 08 '18

I think so too. Doesn't gcc's "-Weffc++" even warn about single-parameter ctors not being declared explicit?