Posted on 2008-11-13 11:27
chefZ 阅读(232)
评论(0) 编辑 收藏 引用
#pragma message(BP "fix me")
__asm int 3;
/*
Value | Usage |
0xCDCDCDCD |
Allocated in heap, but not initialized |
0xDDDDDDDD |
Released heap memory. |
0xFDFDFDFD |
"NoMansLand" fences automatically
placed at boundary of heap memory. Should never be overwritten.
If you do overwrite one, you're probably walking off the end of
an array. |
0xCCCCCCCC |
Allocated on stack, but not initialized |
*/
(pFoo
+ 2000),10
// checked_cast - Uses fast static_cast in Release build,
// but checks cast with an ASSERT in Debug.
// Typical usage:
// class Foo { /* ... */ };
// class Bar : public Foo { /* ... */ };
// Foo * pFoo = new Bar;
// Bar * pBar = checked_cast<;Bar *>;(pFoo);
template <class TypeTo, class TypeFrom>
TypeTo checked_cast(TypeFrom p)
{
ASSERT(dynamic_cast<TypeTo>(p));
return static_cast<TypeTo>(p);
}