/* * Test placement new and array placement new for uBLAS * See if base pointer is effected by array count cookie */ #include #include // User defined type to capture base pointer on construction class udt; udt* base_pointer; class udt { public: udt () { base_pointer = this; } ~udt () {} // required for GCC prior to 3.4 to generate cookie }; int main () { udt a; udt* ap = &a; // Capture placement new offsets for a udt new (ap) udt; int new_offset = int (base_pointer - ap); new (ap) udt [1]; int array_new_offset = int (base_pointer - ap); // Print offsets - we expect 0,0 or 0,sizeof(std::size_t) std::cout << new_offset <<','<< array_new_offset << std::endl; // FIXME find out what version Intel 7.1 for linux says it is #ifdef BOOST_INTEL std::cout << "intel " << BOOST_INTEL <