
January 21st, 2013, 07:55 PM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 1
Time spent in forums: 5 m 46 sec
Reputation Power: 0
|
|
|
Classes - Class template help
I am working on updateing a project from VC++ 6 to VSE 2012. I keep getting the error,
Quote: | Error 7 error C2248: 'cMessage::cBlock::~cBlock' : cannot access private member declared in class 'cMessage::cBlock' c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0 622 1 UAS |
This is the last error I am getting but I cant figure it out.
Thanks in advance for any help.
Code:
_VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
#undef _ALLOC_MEMBER_CONSTRUCT
template<class _Uty>
void destroy(_Uty *_Ptr)
{ // destroy object at _Ptr
_Ptr->~_Uty(); //Error pointed out here
}
size_t max_size() const _THROW0()
{ // estimate maximum array size
return ((size_t)(-1) / sizeof (_Ty));
}
};
(Code of cMessage::cBlock)
class cMessage
{
public:
class cBlock
{
friend class cMessage;
mutable BYTE *m_pStart, *m_pUsed;
private:
cBlock ();
cBlock ( const cBlock &from );
~cBlock ();
BOOL pasteData ( BYTE *&pData, int &nBytes );
int getAlign ( int nBoundary ) const;
BOOL pasteAlign ( int &nBytes );
size_t getUsed () const
{
return ( m_pUsed - m_pStart );
}
BOOL getData ( size_t &nOffset, size_t &nLength, BYTE * &pBuffer ) const;
private:
// Disabled functions
cBlock &operator= ( const cBlock & );
};
private:
typedef std::deque< cBlock > cBlockList;
cBlockList m_blocks;
|