summaryrefslogtreecommitdiffstats
path: root/Source/cmVSSetupHelper.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-22 15:21:04 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-26 13:43:45 (GMT)
commitb1cfaf7b91f87fed0c70a6a7763d565023420788 (patch)
tree9da6e6e0fb7cc952aa831c74c54d48b29d519b1e /Source/cmVSSetupHelper.h
parent3f4c4e7afe6075b18f99c67cf808e2300b3690c4 (diff)
downloadCMake-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.h24
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); }