new keywords

This is a discussion on new keywords within the C++ Programming forums, part of the General Programming Boards category; I do not know what the following keywords mean. If someone could tell me or point me to a website ...

Re: new keywords

Originally posted by Shadow12345 I do not know what the following keywords mean. If someone could tell me or point me to a website (don't say search google) I would be very happy...anyway here is the list of new keywords:

like i said these are all new C++ keywords and I do not know what they mean...I am pretty sure i haven't ever seen any of these in code, and I do not have the MSDN library right now.

Okay here goes!! I'll try to give a brief description of each. Some of these are not new either...

default
This is for switch statements. This keyword has been around a while unless they overloaded it. Anyways, it just means if you this as the last case and no case was found matching the argument it will go into the default case.

xor_eq(^=)
bitwise XOR operator. I'm not going to get into that but it the exclusive OR operator.

explicit
Disable implicit conversion constructors when using classes.

asm
inline assembly code

compl (~)
One's complement. This flips every 1 bit to 0 and every 0 bit to 1.

mutable
When put before a member variable, this tells the compiler that the data can be modified in a const member function.

volatile
This is probably *the* most understood keyword by most C++ programmers. It is poorly documented all around. It's fairly complicated but you use these keyword to tell the compiler the data in the memory location may change at any time without notice.

auto
C++ compilers treat all local variables as auto by default. Basically it gets destroyed at the end of it's scope. Sometimes people use this to clarify scopes but it is optional.

register
register keyword. Use this before variables you hope to put inside a CPU's registers. This keyword *asks* to put the variable in a register but does not guarantee it. Try to use these on loop indexes that are used often.

union
This is a way to group unlike data using a single name like a structure. The only difference is structure reserves different memory for every member. Union members share the same memory location. Only one member can use it at a time though.

Re: new keywords

Originally posted by Shadow12345 I do not know what the following keywords mean. If someone could tell me or point me to a website (don't say search google) I would be very happy...anyway here is the list of new keywords: