Ditai C++ Study Notes-Lesson 41-Type Conversion Function (Part 1)

The conversion constructor
(1) has one and only one parameter
(2) the parameter is a basic type
(3) the parameter is another class type

explicit
(1) In the project, the explicit keyword is used to prevent the compiler's conversion attempts
(2) The conversion constructor can only be displayed conversion by explicit

Guess you like

Origin blog.csdn.net/cj532419842/article/details/115192403