From b1cfaf7b91f87fed0c70a6a7763d565023420788 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 22 Aug 2019 11:21:04 -0400 Subject: cmVSSetupHelper: Remove unused SmartBSTR copy operations For our use case we do not actually need to copy these. Mark the operations as `= delete` to simplify the code. --- Source/cmVSSetupHelper.h | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index 9382c05..ad46c75 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -74,28 +74,8 @@ class SmartBSTR { public: SmartBSTR() { str = NULL; } - SmartBSTR(const SmartBSTR& src) - { - if (src.str != NULL) { - str = - ::SysAllocStringByteLen((char*)src.str, ::SysStringByteLen(src.str)); - } else { - str = ::SysAllocStringByteLen(NULL, 0); - } - } - SmartBSTR& operator=(const SmartBSTR& src) - { - if (str != src.str) { - ::SysFreeString(str); - if (src.str != NULL) { - str = - ::SysAllocStringByteLen((char*)src.str, ::SysStringByteLen(src.str)); - } else { - str = ::SysAllocStringByteLen(NULL, 0); - } - } - return *this; - } + SmartBSTR(const SmartBSTR& src) = delete; + SmartBSTR& operator=(const SmartBSTR& src) = delete; operator BSTR() const { return str; } BSTR* operator&() throw() { return &str; } ~SmartBSTR() throw() { ::SysFreeString(str); } -- cgit v0.12