大约有 6,000 项符合查询结果(耗时:0.0270秒) [XML]
When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
...
static_cast is the first cast you should attempt to use. 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). In m...
Why use static_cast(x) instead of (int)x?
I've heard that the static_cast function should be preferred to C-style or simple function-style casting. Is this true? Why?
...
How to update column with null value
... your column cannot be null, when you set the value to null it will be the cast value to it.
Here a example
mysql> create table example ( age int not null, name varchar(100) not null );
mysql> insert into example values ( null, "without num" ), ( 2 , null );
mysql> select * from example;
...
What is the difference between static_cast and C style casting?
Is there any reason to prefer static_cast<> over C style casting? Are they equivalent? Is their any sort of speed difference?
...
Java Class.cast() vs. cast operator
Having being taught during my C++ days about evils of the C-style cast operator I was pleased at first to find that in Java 5 java.lang.Class had acquired a cast method.
...
Should I use static_cast or reinterpret_cast when casting a void* to whatever
Both static_cast and reinterpret_cast seem to work fine for casting void* to another pointer type. Is there a good reason to favor one over the other?
...
dynamic_cast and static_cast in C++
I am quite confused with the dynamic_cast keyword in C++.
10 Answers
10
...
When to use reinterpret_cast?
I am little confused with the applicability of reinterpret_cast vs static_cast . From what I have read the general rules are to use static cast when the types can be interpreted at compile time hence the word static . This is the cast the C++ compiler uses internally for implicit casts also.
...
What is the exact problem with multiple inheritance?
...g part of the problem, if one does not need to allow identity-preserving upcasts and downcasts among all of the types from which an instance is derived or for which it is substitutable. Given X:B; Y:B; and Z:X,Y; assume someZ is an instance of Z. With virtual inheritance, (B)(X)someZ and (B)(Y)som...
Why shouldn't I use “Hungarian Notation”?
...raight C development with an older IDE ... that way I know there's no type casting issues.
– Beep beep
Mar 7 '09 at 19:24
3
...