shorten special class members declarations

This commit is contained in:
Garux 2021-10-14 23:31:07 +03:00
parent 5ef76b0212
commit 6a7550a6ba
8 changed files with 3 additions and 31 deletions

View File

@ -148,10 +148,7 @@ private:
public: public:
SelectionList() = default; SelectionList() = default;
SelectionList( const SelectionList& ) = delete;
SelectionList( SelectionList&& ) noexcept = delete; SelectionList( SelectionList&& ) noexcept = delete;
SelectionList& operator=( const SelectionList& ) = delete;
SelectionList& operator=( SelectionList&& ) noexcept = delete;
iterator begin(){ iterator begin(){
return m_selection.begin(); return m_selection.begin();

View File

@ -774,11 +774,7 @@ public:
m_instance.get().setChildSelectedChangedCallback( Callback() ); m_instance.get().setChildSelectedChangedCallback( Callback() );
ASSERT_MESSAGE( empty(), "GraphTreeNode::~GraphTreeNode: memory leak" ); ASSERT_MESSAGE( empty(), "GraphTreeNode::~GraphTreeNode: memory leak" );
} }
GraphTreeNode() = delete;
GraphTreeNode( const GraphTreeNode& ) = delete;
GraphTreeNode( GraphTreeNode&& ) noexcept = delete; GraphTreeNode( GraphTreeNode&& ) noexcept = delete;
GraphTreeNode& operator=( const GraphTreeNode& ) = delete;
GraphTreeNode& operator=( GraphTreeNode&& ) noexcept = delete;
iterator begin(){ iterator begin(){
return m_childnodes.begin(); return m_childnodes.begin();

View File

@ -31,10 +31,8 @@
class void_ptr class void_ptr
{ {
private:
void *ptr; void *ptr;
public: public:
void_ptr() = delete;
void_ptr( void *p ) : ptr( p ) {} void_ptr( void *p ) : ptr( p ) {}
template<typename T> template<typename T>
operator T*() const { operator T*() const {

View File

@ -51,11 +51,7 @@ struct script_t
end( start + size ), end( start + size ),
line( 1 ) line( 1 )
{} {}
script_t() = delete;
script_t( const script_t& ) = delete;
script_t( script_t&& ) noexcept = delete; script_t( script_t&& ) noexcept = delete;
script_t& operator=( const script_t& ) = delete;
script_t& operator=( script_t&& ) noexcept = delete;
~script_t(){ ~script_t(){
free( buffer ); free( buffer );
} }

View File

@ -19,12 +19,11 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#if !defined( INCLUDED_STRINGFIXESIZE_H ) #pragma once
#define INCLUDED_STRINGFIXESIZE_H
#include "stream/textstream.h" #include "stream/textstream.h"
#include "string/string.h" #include "string/string.h"
#include "cmdlib.h" #include "inout.h"
/// \brief A TextOutputStream which writes to a null terminated fixed length char array. /// \brief A TextOutputStream which writes to a null terminated fixed length char array.
@ -41,10 +40,6 @@ public:
explicit StringFixedSize( const char* string ){ explicit StringFixedSize( const char* string ){
operator()( string ); operator()( string );
} }
StringFixedSize( const StringFixedSize& ) = default;
StringFixedSize( StringFixedSize&& ) noexcept = default;
StringFixedSize& operator=( const StringFixedSize& ) = default;
StringFixedSize& operator=( StringFixedSize&& ) noexcept = default;
std::size_t write( const char* buffer, std::size_t length ) override { std::size_t write( const char* buffer, std::size_t length ) override {
if( m_length + length < SIZE ){ if( m_length + length < SIZE ){
for( auto i = length; i != 0; --i ) for( auto i = length; i != 0; --i )
@ -91,6 +86,3 @@ inline StringFixedSize<SIZE>& operator<<( StringFixedSize<SIZE>& ostream, const
} }
using String64 = StringFixedSize<64>; using String64 = StringFixedSize<64>;
#endif

View File

@ -77,6 +77,7 @@ struct VFS_PAK
unzFile zipfile; unzFile zipfile;
const CopiedString unzFilePath; const CopiedString unzFilePath;
VFS_PAK( unzFile zipfile, const char *unzFilePath ) : zipfile( zipfile ), unzFilePath( unzFilePath ) {}; VFS_PAK( unzFile zipfile, const char *unzFilePath ) : zipfile( zipfile ), unzFilePath( unzFilePath ) {};
VFS_PAK( VFS_PAK&& ) noexcept = delete;
~VFS_PAK(){ ~VFS_PAK(){
unzClose( zipfile ); unzClose( zipfile );
} }

View File

@ -425,7 +425,6 @@ struct image_t
height(height ), height(height ),
pixels( pixels ) pixels( pixels )
{} {}
image_t( const image_t& ) = delete;
image_t( image_t&& other ) noexcept : image_t( image_t&& other ) noexcept :
name( std::move( other.name ) ), name( std::move( other.name ) ),
filename( std::move( other.filename ) ), filename( std::move( other.filename ) ),
@ -433,8 +432,6 @@ struct image_t
height( other.height ), height( other.height ),
pixels( std::exchange( other.pixels, nullptr ) ) pixels( std::exchange( other.pixels, nullptr ) )
{} {}
image_t& operator=( const image_t& ) = delete;
image_t& operator=( image_t&& ) noexcept = delete;
~image_t(){ ~image_t(){
free( pixels ); free( pixels );
} }

View File

@ -48,11 +48,6 @@ struct metaVertex_t : public bspDrawVert_t
std::list<metaVertex_t> *m_metaVertexGroup; // reference to own group of vertices with equal .xyz position std::list<metaVertex_t> *m_metaVertexGroup; // reference to own group of vertices with equal .xyz position
metaVertex_t() = default; metaVertex_t() = default;
metaVertex_t( const metaVertex_t& ) = default;
metaVertex_t( metaVertex_t&& ) noexcept = default;
metaVertex_t& operator=( const metaVertex_t& ) = default;
metaVertex_t& operator=( metaVertex_t&& ) noexcept = default;
metaVertex_t( const bspDrawVert_t& vert ) : bspDrawVert_t( vert ){} metaVertex_t( const bspDrawVert_t& vert ) : bspDrawVert_t( vert ){}
}; };