autoptr_test.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "autoptr.h"
3 
4 using namespace std;
5 using namespace GMapping;
6 
8 
9 int main(int argc, const char * const * argv){
10  double* d1=new double(10.);
11  double* d2=new double(20.);
12  cout << "Construction test" << endl;
13  DoubleAutoPtr pd1(d1);
14  DoubleAutoPtr pd2(d2);
15  cout << *pd1 << " " << *pd2 << endl;
16  cout << "Copy Construction" << endl;
17  DoubleAutoPtr pd3(pd1);
18  cout << *pd3 << endl;
19  cout << "assignment" << endl;
20  pd3=pd2;
21  pd1=pd2;
22  cout << *pd1 << " " << *pd2 << " " << *pd3 << " " << endl;
23  cout << "conversion operator" << endl;
24  DoubleAutoPtr nullPtr;
25  cout << "conversion operator " << !(nullPtr) << endl;
26  cout << "neg conversion operator " << nullPtr << endl;
27  cout << "conversion operator " << (int)pd1 << endl;
28  cout << "neg conversion operator " << !(pd1) << endl;
29 }
int main(int argc, const char *const *argv)
Definition: autoptr_test.cpp:9
autoptr< double > DoubleAutoPtr
Definition: autoptr_test.cpp:7


openslam_gmapping
Author(s): Giorgio Grisetti, Cyrill Stachniss, Wolfram Burgard
autogenerated on Mon Jun 10 2019 14:04:22