diff options
author | Brad King <brad.king@kitware.com> | 2019-08-22 15:21:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-26 13:43:45 (GMT) |
commit | b1cfaf7b91f87fed0c70a6a7763d565023420788 (patch) | |
tree | 9da6e6e0fb7cc952aa831c74c54d48b29d519b1e /Source/cmVSSetupHelper.h | |
parent | 3f4c4e7afe6075b18f99c67cf808e2300b3690c4 (diff) | |
download | CMake-b1cfaf7b91f87fed0c70a6a7763d565023420788.zip CMake-b1cfaf7b91f87fed0c70a6a7763d565023420788.tar.gz CMake-b1cfaf7b91f87fed0c70a6a7763d565023420788.tar.bz2 |
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.
Diffstat (limited to 'Source/cmVSSetupHelper.h')
-rw-r--r-- | Source/cmVSSetupHelper.h | 24 |
1 files 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); } |