#include #include #include #include using namespace std; template struct verbose_allocator : Base { verbose_allocator() {} template verbose_allocator(const U&) {} template struct rebind { typedef verbose_allocator< typename Base::template rebind::other > other; }; typename Base::pointer allocate(typename Base::size_type s) { cout << "allocated " << s << endl; return Base::allocate(s); } }; int main() { typedef list > > L; cout << "default ctor" << endl; L l; // #1 Allocates sentinel node upon // default construction. cout << endl << "move ctor" << endl; L m = move(l); // #2 And also upon move construction. }