Replace empty constructors with default constructors #88

This commit is contained in:
nillerusr
2022-11-05 14:23:05 +03:00
parent ba90de20d9
commit 8fbc002a37
97 changed files with 192 additions and 2620 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ class CRefPtr : public CBaseAutoPtr<T>
{
typedef CBaseAutoPtr<T> BaseClass;
public:
CRefPtr() {}
CRefPtr() = default;
CRefPtr( T *pInit ) : BaseClass( pInit ) {}
CRefPtr( const CRefPtr<T> &from ) : BaseClass( from ) {}
~CRefPtr() { if ( BaseClass::m_pObject ) BaseClass::m_pObject->Release(); }
+2 -2
View File
@@ -57,7 +57,7 @@ public:
K m_key;
V m_value;
CUtlKeyValuePair() {}
CUtlKeyValuePair() = default;
template < typename KInit >
explicit CUtlKeyValuePair( const KInit &k ) : m_key( k ) {}
@@ -76,7 +76,7 @@ public:
typedef const K ValueReturn_t;
K m_key;
CUtlKeyValuePair() {}
CUtlKeyValuePair() = default;
template < typename KInit >
explicit CUtlKeyValuePair( const KInit &k ) : m_key( k ) {}
+3 -4
View File
@@ -257,9 +257,8 @@ public:
typedef _CUtlLinkedList_constiterator_t< List_t > Base;
// Default constructor -- gives a currently unusable iterator.
_CUtlLinkedList_iterator_t()
{
}
_CUtlLinkedList_iterator_t() = default;
// Normal constructor.
_CUtlLinkedList_iterator_t( const List_t& list, IndexType_t index )
: _CUtlLinkedList_constiterator_t< List_t >( list, index )
@@ -1231,7 +1230,7 @@ private:
struct Node_t
{
Node_t() {}
Node_t() = default;
Node_t( const T &_elem ) : elem( _elem ) {}
T elem;
+1 -3
View File
@@ -175,9 +175,7 @@ public:
struct Node_t
{
Node_t()
{
}
Node_t() = default;
Node_t( const Node_t &from )
: key( from.key ),
+1 -1
View File
@@ -17,7 +17,7 @@ template<typename T1, typename T2>
class CUtlPair
{
public:
CUtlPair() {}
CUtlPair() = default;
CUtlPair( T1 t1, T2 t2 ) : first( t1 ), second( t2 ) {}
bool operator<( const CUtlPair<T1,T2> &rhs ) const {
+1 -1
View File
@@ -32,7 +32,7 @@ template <typename T>
class CDefLess
{
public:
CDefLess() {}
CDefLess() = default;
CDefLess( int i ) {}
inline bool operator()( const T &lhs, const T &rhs ) const { return ( lhs < rhs ); }
inline bool operator!() const { return false; }
+2 -2
View File
@@ -39,7 +39,7 @@ public:
m_nStride = nByteStride / sizeof( T );
}
FORCEINLINE CStridedPtr<T>( void ) {}
FORCEINLINE CStridedPtr<T>( void ) = default;
T *operator->(void) const
{
return m_pData;
@@ -81,7 +81,7 @@ public:
m_nStride = nByteStride / sizeof( T );
}
FORCEINLINE CStridedConstPtr<T>( void ) {}
FORCEINLINE CStridedConstPtr<T>( void ) = default;
const T *operator->(void) const
{
+1 -3
View File
@@ -138,9 +138,7 @@ protected:
class CStringPoolIndex
{
public:
inline CStringPoolIndex()
{
}
inline CStringPoolIndex() = default;
inline CStringPoolIndex( unsigned short iPool, unsigned short iOffset )
: m_iPool(iPool), m_iOffset(iOffset)
+1 -1
View File
@@ -1487,7 +1487,7 @@ public:
return strcmp( *sz1, *sz2 );
}
CUtlStringList(){}
CUtlStringList() = default;
CUtlStringList( char const *pString, char const *pSeparator )
{