فهرست منبع

Applying rule of three on string types by removing redundant destructor and copy constructor.

David Piuva 10 ماه پیش
والد
کامیت
6bf6321206
2فایلهای تغییر یافته به همراه0 افزوده شده و 5 حذف شده
  1. 0 2
      Source/DFPSR/api/stringAPI.cpp
  2. 0 3
      Source/DFPSR/api/stringAPI.h

+ 0 - 2
Source/DFPSR/api/stringAPI.cpp

@@ -73,8 +73,6 @@ ReadableString::ReadableString(const String& source)
 String::String() {}
 String::String() {}
 String::String(const char* source) { atomic_append_ascii(*this, source); }
 String::String(const char* source) { atomic_append_ascii(*this, source); }
 String::String(const DsrChar* source) { atomic_append_utf32(*this, source); }
 String::String(const DsrChar* source) { atomic_append_utf32(*this, source); }
-String::String(const String& source)
-: ReadableString(source.characters, source.view){}
 String::String(const ReadableString& source)
 String::String(const ReadableString& source)
 : ReadableString(source.characters, source.view) {}
 : ReadableString(source.characters, source.view) {}
 
 

+ 0 - 3
Source/DFPSR/api/stringAPI.h

@@ -123,8 +123,6 @@ public:
 	: characters(characters), view(view) {}
 	: characters(characters), view(view) {}
 	// Create from String by sharing the buffer
 	// Create from String by sharing the buffer
 	ReadableString(const String& source);
 	ReadableString(const String& source);
-	// Destructor
-	~ReadableString() {} // Do not override the non-virtual destructor.
 };
 };
 
 
 // A safe and simple string type
 // A safe and simple string type
@@ -143,7 +141,6 @@ public:
 	String(const char* source);
 	String(const char* source);
 	String(const DsrChar* source);
 	String(const DsrChar* source);
 	String(const ReadableString& source);
 	String(const ReadableString& source);
-	String(const String& source);
 };
 };
 
 
 // Used as format tags around numbers passed to string_append or string_combine
 // Used as format tags around numbers passed to string_append or string_combine