21 #include <boost/shared_ptr.hpp> 22 #include <boost/intrusive_ptr.hpp> 27 using namespace boost;
28 using namespace gtsam;
43 virtual void method() = 0;
50 void method()
override { data = rand(); }
67 int main(
int argc,
char *argv[]) {
70 cout <<
"Stack objects:" << endl;
71 cout <<
"Base:" << endl;
73 cout <<
"Derived:" << endl;
76 cout <<
"Heap objects:" << endl;
77 cout <<
"Base:" << endl;
79 cout <<
"Derived:" << endl;
81 cout <<
"Derived with base pointer:" << endl;
90 for(
int i=0;
i<
n; ++
i)
94 for(
int i=0;
i<
n; ++
i)
98 for(
int i=0;
i<
n; ++
i) {
105 for(
int i=0;
i<
n; ++
i)
117 for(
int i=0;
i<
n; ++
i)
121 for(
int i=0;
i<
n; ++
i)
124 gttic_(dynamic_cast_does_nothing);
125 for(
int i=0;
i<
n; ++
i)
127 gttoc_(dynamic_cast_does_nothing);
129 for(
int i=0;
i<
n; ++
i)
~VirtualDerived() override
void tictoc_finishedIteration_()
int main(int argc, char *argv[])
~DtorTestDerived() override