Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include"RefCountPtrT.h"
- using namespace std;
- template <class T>
- RefCountPtrT<T>::RefCountPtrT(){
- ptr = NULL;
- }
- template <class T>
- RefCountPtrT<T>::~RefCountPtrT(){
- //cout << "Destructor for ptr\n";
- }
- template <class T>
- RefCountPtrT<T>::RefCountPtrT(RefCountPtrT & r){
- cout << "CC for ptr\n";
- }
- template <class T>
- void RefCountPtrT<T>::operator=(RefCountPtrT & r){
- cout << "= for ptr\n";
- }
- template <class T>
- void RefCountPtrT<T>::makeNull() {
- ptr = NULL;
- }
- template <class T>
- bool RefCountPtrT<T>::isNull() {
- if (ptr == NULL){
- return true;
- }
- else
- return false;
- }
- template <class T>
- void RefCountPtrT<T>::allocNew() {
- ptr = new RefCountT<T>;
- };
- template <class T>
- void RefCountPtrT<T>::setVal(T val) {
- ptr->setVal(val);
- }
- template <class T>
- T RefCountPtrT<T>::getVal() {
- return ptr->getVal();
- }
Add Comment
Please, Sign In to add comment