Difference between revisions of "C++"
From LPTMS Wiki
m |
m |
||
Line 1: | Line 1: | ||
==Pointers handling== | ==Pointers handling== | ||
pointers are not always easy to handle, particularly for destruction, memory management... There exists some solutions provided by boost | pointers are not always easy to handle, particularly for destruction, memory management... There exists some solutions provided by boost | ||
− | * [http://www.boost.org/doc/libs/release/libs/smart_ptr/smart_ptr.htm Smart pointers] | + | * [http://www.boost.org/doc/libs/release/libs/smart_ptr/smart_ptr.htm Smart pointers] (shared_ptr,...) |
* [http://www.boost.org/doc/libs/release/libs/ptr_container Pointer containers] (vector, list, deque...) | * [http://www.boost.org/doc/libs/release/libs/ptr_container Pointer containers] (vector, list, deque...) | ||
+ | |||
---- | ---- | ||
+ | |||
testing c++ source display: | testing c++ source display: |
Revision as of 11:27, 11 February 2011
Pointers handling
pointers are not always easy to handle, particularly for destruction, memory management... There exists some solutions provided by boost
- Smart pointers (shared_ptr,...)
- Pointer containers (vector, list, deque...)
testing c++ source display:
template<typename T> class B { private: T t; public: B(T const& _t) : t(_t) {}; T value() const {return t;}; }; int main() { B<int> b(2); }