msvc work around

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@476 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-01-16 00:05:02 +00:00
parent 2287a53487
commit 95fadc5260
4 changed files with 101 additions and 8 deletions

View file

@ -41,13 +41,7 @@ namespace Loki
template<class T>
struct AutoDeletePimpl
{
static void Destroy(T ptr)
{
typedef char T_must_be_defined[
sizeof(typename TypeTraits<T>::PointeeType) ? 1 : -1 ];
delete ptr;
ptr = 0;
}
static void Destroy(T ptr);
};
template<class T>

View file

@ -16,6 +16,29 @@
namespace Loki
{
template<class T>
void AutoDeletePimpl<T>::Destroy(T ptr)
{
#ifndef _MSC_VER // msvc bug
typedef char T_must_be_defined[
sizeof(typename TypeTraits<T>::PointeeType) ? 1 : -1 ];
delete ptr;
ptr = 0;
#else
#pragma warning(push)
#pragma warning(disable: 4150)
delete ptr;
ptr = 0;
#pragma warning(pop)
#endif
}
template
<
class Impl,
@ -24,7 +47,7 @@ namespace Loki
>
inline
PimplLife<Impl,Ptr,Del>::PimplLife() //: ptr(Ptr()) this owerwrites the pointer to PtrImpl
{} // when using DeclaredRimpl!!
{} // when using DeclaredRimpl!!
template
<