Visual Studio 2008 Overview
February 22nd, 2009
No comments
// Example 1 // Allocation T* pv = (T*)malloc( sizeof(T) ); // Construction ::new( pv ) T( /*arg-list*/ ); ... // Destruction pv->T::~T(); // Deallocation free( pv ); // Example 2 class Blanks { public: Blanks(){} void* operator new( size_t stAllocateBlock, int chInit ) { void* pvTemp = malloc( stAllocateBlock ); if( pvTemp != 0 ) { memset( pvTemp, chInit, stAllocateBlock ); } return pvTemp; } }; // For discrete objects of type Blanks, the global operator new function // is hidden. Therefore, the following code allocates an object of type // Blanks and initializes it to 0xa5 Blanks *a5 = new(0xa5) Blanks; bool b = a5 != 0;
std::map<wstring, wstring> map1; std::map<wstring, wstring> map2(map1); std::map<wstring, wstring> map3(map2.begin(), map2.end()); map1.insert(map3.begin(), map3.end()); map2 = map3; std::copy(map2.begin(), map2.end(), inserter(map1, map1.end()));
Сайты, содержащие ссылки на электронные издания книг.