autoptr_test.cpp
Go to the documentation of this file.
1 #include <iostream>
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 }
GMapping
Definition: configfile.cpp:34
DoubleAutoPtr
autoptr< double > DoubleAutoPtr
Definition: autoptr_test.cpp:7
autoptr.h
GMapping::autoptr
Definition: autoptr.h:8
main
int main(int argc, const char *const *argv)
Definition: autoptr_test.cpp:9


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51