I have come across the following piece of code and i couldn't understand what it means:
typedef int INT; 5 .INT::~INT();
Note: There is a space between the numeric 5 and decimal.
Questions: 1. Could somebody explain what exactly does the two lines above mean? 2. Why would it not work without typedef? Any reason behind it?5 .int::~int()
throws error.
The language defines eight Java primitive data types: boolean, float, double, byte, short, int, long and char. These eight Java primitive data types fall into the category of things that aren't objects.
New object types can be constructed using existing object types, but at the lowest level there are some built-in object types called primitives. These include: C integers: byte (equivalent to C's char), short, int, long, long long and unsigned equivalents. C floats: float, double and long double.
There are two primitive floating point types available in Objective-C: The float type is a 32-bit single precision float point value that uses a single sign bit, an 8-bit mantissa and 23 bits of exponent when storing numbers.
primitive types are immutable, objects only have an immutable reference, but their value can change over time. primitive types are passed by value. Objects are passed by reference. primitive types are copied by value. Objects are copied by reference.
.INT::~INT()
is a pseudo destructor call, useful for templated code.
Note that it can't be used without the typedef
type.
Standardese:
C++03 §5.2.4 “Pseudo destructor call”:
- The use of a pseudo-destructor-name after a dot
.
or arrow->
operator represents the destructor for the non-class type named by type-name. The result shall only be used as the operand for the function call operator()
, and the result of such a call has typevoid
. The only effect is the evaluation of the postfix-expression before the dot or arrow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With