![]() Static_cast can also cast through inheritance hierarchies. ![]() ![]() A T(something, something_else) is safe, however, and guaranteed to call the constructor. In many cases, explicitly stating static_cast isn't necessary, but it's important to note that the T(something) syntax is equivalent to (T)something and should be avoided (more on that later). It does things like implicit conversions between types (such as int to float, or pointer to void*), and it can also call explicit conversion functions (or implicit ones). ![]() Static_cast is the first cast you should attempt to use.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |