mercredi 26 octobre 2016

c++ explicit specifier preventing copy-initalisation

Ive been looking into the explicit specifier and I was hoping I could have some feedback (small examples would be perfect) on the following:

  1. How does an explicit constructor prevent copy initialization?
  2. Can you provide a small example of how explicit has a great benefit over implicit constructors?

Im not so concerned about explicit conversion functions (C++11), just the general ctor principles

Any feedback would be greatly appreciated

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire