TOP Language C C++/CLR VC stl
- standards
- Tips
- Error Message
- Languages References
- Library
- Source code
- Blog
- FAQ
- Books
- Tutorials
- VisualC++
- links of links
- Redistributables
- misc compilers
- paper
dynamic_cast < type-id > ( expression ) | run-time type check is made | base-to-derived conversions are not allowed ex |
static_cast < type-id> ( expression ) | No run-time type check is made to help ensure the safety of the conversion | ex |
const_cast > type-id < ( expression ) | Removes the const, volatile, and __unaligned attribute(s) from a class | |
reinterpret_cast < type-id > ( expression ) | Allows any pointer to be converted into any other pointer type. | a simple binary copy |
[cli]::safe_cast<type-id>(expression) | change the type of an expression and generate verifiable MSIL code. |
vc | #ifdef _MSC_VER | VC6 – 1200 VC7 – 1300 VC8 – 1400 VC9 – 1500 |
vc | #ifdef _MSC_FULL_VER | 14.00.50727.762->140050727762 |
例外処理プログラミング
MSDN-C と C++ での例外処理、第 1 部
Exceptions and Error Handling
Resource acquisition is initialization RAII
... in some file
static char ERR1[]="error1";
throw ERR1
... in some other file
MSDN-C と C++ での例外処理、第 1 部
Exceptions and Error Handling
Resource acquisition is initialization RAII
... in some file
static char ERR1[]="error1";
throw ERR1
... in some other file
try { } catch(char * msg){ }(...){ }
samples
A &operator=( const A &a );
A &operator=( const A &a );
Sub-Class member doesn't belong to the same scope of the Super-class member with the same name.
class Base { int A(int); };
class Sub:Base { int A(char *); int A(int a){Base::A(a);} };
class Base { int A(int); };
class Sub:Base { int A(char *); int A(int a){Base::A(a);} };
THIS WON'T WORK. A() is create and delete another A(9) instance in it. so i is still undefined.
class A { public: int i; A(){ A(9);} A(int i) { this->i = i }; };Default parameter(below) may help, or just create a shred private function.
class A { public: int i; A(int i=9) { this->i = i }; };
template <typename> struct A{ typedef int X; }; template <typename T> struct B{ //A<T>::X x; // error typename A<T>::X y; // OK }; B<void> b;
最新コメント