mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-17 07:11:52 +08:00
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.
This commit is contained in:
@@ -74,28 +74,8 @@ class SmartBSTR
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SmartBSTR() { str = NULL; }
|
SmartBSTR() { str = NULL; }
|
||||||
SmartBSTR(const SmartBSTR& src)
|
SmartBSTR(const SmartBSTR& src) = delete;
|
||||||
{
|
SmartBSTR& operator=(const SmartBSTR& src) = delete;
|
||||||
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;
|
|
||||||
}
|
|
||||||
operator BSTR() const { return str; }
|
operator BSTR() const { return str; }
|
||||||
BSTR* operator&() throw() { return &str; }
|
BSTR* operator&() throw() { return &str; }
|
||||||
~SmartBSTR() throw() { ::SysFreeString(str); }
|
~SmartBSTR() throw() { ::SysFreeString(str); }
|
||||||
|
Reference in New Issue
Block a user