在 英语 中使用 Implicit conversions 的示例及其翻译为 中文
{-}
-
Political
-
Ecclesiastic
-
Programming
There are no implicit conversions to the char type.
The set explicit conversions includes all implicit conversions.
No implicit conversions are performed for Boolean or string values;
There are no implicit conversions from other types to the char type.
A bizarre and only slightly-clever solution in Scala using implicit conversions:.
The pre-defined implicit conversions always succeed and never cause exceptions to be thrown.
Specifies that a constructor or conversion function(since C++11) is explicit, that is,it cannot be used for implicit conversions and copy-initialization.
Properly designed user-defined implicit conversions should exhibit these characteristics as well.
Go doesn't have implicit conversions between types, such as int and uint, or floats and int.
The gradual type checker also allows implicit conversions between more complicated types.
In general, user-defined implicit conversions should be designed to never throw exceptions and never lose information.
The type of the expression a?? b depends on which implicit conversions are available between the types of the operands.
Go doesn't even allow implicit conversions between types that, in C, would just be typedefs.
The rule follows from the fact that there are no implicit conversions between the decimal type and the double and float types.
I mentioned earlier that no implicit conversions are allowed, but you may have noticed in the above snippet, 5 is not written as 5.0.
The rule follows from the fact that there are no implicit conversions between the decimal type and the double and float types.
This is consistent with the desire to eliminate implicit conversions, and requiring an explicit conversion between float1 and float is cumbersome and needlessly verbose.
If the initializer clause is an expression, implicit conversions are allowed as per copy-initialization, except if they are narrowing(as in list-initialization)(since C++11).
Implicit conversion to bool(new to 1.5).
Most values in JavaScript support implicit conversion to a string.
Syntax 3 does not support implicit conversion of the first argument.
Weak type: Implicit conversion may surprise unwary programmers and lead to unexpected bugs.
One commonly encountered difference is that C allows implicit conversion from void* to other pointer types, but C++ does not.
The user-defined conversion is applied:• If S is not SX,then a standard implicit conversion from S to SX is performed.
For every argument there must be at least one implicit conversion sequence that converts it to the corresponding parameter.
An implicit conversion exists from a class type to any of its base class types.
This can include reviewing previous years' trends in data, the internal consistencies of energy flows,the verification of implicit conversion efficiencies of energy processes etc.
The implicit conversion of strings follows the existing rules for data type conversions.
Notice also that there is no implicit conversion from floating-point types to long.