mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 14:08:35 +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:
|
||||
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); }
|
||||
|
Reference in New Issue
Block a user