From 3a135b20e2c3c3dd407b9b768a411645eca6a7e0 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 9 Mar 2021 11:49:28 +0100 Subject: Various cleanup and use of C++11 features --- ACE/ace/SString.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'ACE/ace/SString.h') diff --git a/ACE/ace/SString.h b/ACE/ace/SString.h index 2d599c6e54a..81651b78dbb 100644 --- a/ACE/ace/SString.h +++ b/ACE/ace/SString.h @@ -59,39 +59,40 @@ public: using ACE_WString::size_type; /// Default constructor. - ACE_NS_WString (ACE_Allocator *alloc = 0); + ACE_NS_WString (ACE_Allocator *alloc = nullptr); /// Constructor that copies @a s into dynamically allocated memory. ACE_NS_WString (const char *s, - ACE_Allocator *alloc = 0); + ACE_Allocator *alloc = nullptr); /// Constructor that copies @a s into dynamically allocated memory. ACE_NS_WString (const ACE_WSTRING_TYPE *s, - ACE_Allocator *alloc = 0); + ACE_Allocator *alloc = nullptr); #if defined (ACE_WSTRING_HAS_USHORT_SUPPORT) /// Constructor that takes in a ushort16 string (mainly used by the /// ACE Name_Space classes) ACE_NS_WString (const ACE_UINT16 *s, size_type len, - ACE_Allocator *alloc = 0); + ACE_Allocator *alloc = nullptr); #endif /* ACE_WSTRING_HAS_USHORT_SUPPORT */ /// Constructor that copies @a len ACE_WSTRING_TYPE's of @a s into dynamically /// allocated memory (will NUL terminate the result). ACE_NS_WString (const ACE_WSTRING_TYPE *s, size_type len, - ACE_Allocator *alloc = 0); + ACE_Allocator *alloc = nullptr); /// Constructor that dynamically allocates memory for @a len + 1 /// ACE_WSTRING_TYPE characters. The newly created memory is set memset to 0. - ACE_NS_WString (size_type len, ACE_Allocator *alloc = 0); + ACE_NS_WString (size_type len, ACE_Allocator *alloc = nullptr); /// Copy constructor. - ACE_NS_WString (const ACE_NS_WString &s); + ACE_NS_WString (const ACE_NS_WString &s) = default; + ACE_NS_WString &operator= (const ACE_NS_WString&) = default; /// Constructor that copies @a c into dynamically allocated memory. - ACE_NS_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc = 0); + ACE_NS_WString (ACE_WSTRING_TYPE c, ACE_Allocator *alloc = nullptr); /// Transform into a copy of the ASCII character representation. /// (caller must delete) @@ -136,20 +137,20 @@ public: static const size_type npos; /// Default constructor. - ACE_SString (ACE_Allocator *alloc = 0); + ACE_SString (ACE_Allocator *alloc = nullptr); /// Constructor that copies @a s into dynamically allocated memory. - ACE_SString (const char *s, ACE_Allocator *alloc = 0); + ACE_SString (const char *s, ACE_Allocator *alloc = nullptr); /// Constructor that copies @a len chars of @a s into dynamically /// allocated memory (will NUL terminate the result). - ACE_SString (const char *s, size_type len, ACE_Allocator *alloc = 0); + ACE_SString (const char *s, size_type len, ACE_Allocator *alloc = nullptr); /// Copy constructor. ACE_SString (const ACE_SString &); /// Constructor that copies @a c into dynamically allocated memory. - ACE_SString (char c, ACE_Allocator *alloc = 0); + ACE_SString (char c, ACE_Allocator *alloc = nullptr); /// Default destructor. ~ACE_SString (); -- cgit v1.2.1