标签: c++ pointers
如何断言指针的指向内容在堆上?例如
int i; int* p1 = &i; int* p2 = new int; assert(!onHeap(p1)); assert(onHeap(p2));