#pragma once



#include "namespace_start.h"
template<typename T,typename H>
class RAIIT:public boost::noncopyable{

public:
	typename typedef H Handle;
protected:
	Handle m_handle;

public:

	RAIIT(){

		m_handle = nullptr;

	}

	~RAIIT(){
		reinterpret_cast <T*>(this)->Dispose();
		

	}

	Handle Detach(){

		Handle t = m_handle;
		m_handle = nullptr;

		return t;
	}

	

	Void Attach(Handle t){

		if(m_handle == nullptr){

			m_handle = t;

		}

	}



};

#include "namespace_end.h"