Define default special member functions in headers

This commit is contained in:
Chris Thrasher 2023-12-10 00:00:09 -07:00
parent 7223a5db63
commit e11154e7f7
28 changed files with 20 additions and 103 deletions

View File

@ -193,7 +193,7 @@ protected:
/// This constructor is only meant to be called by derived classes. /// This constructor is only meant to be called by derived classes.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundRecorder(); SoundRecorder() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Set the processing interval /// \brief Set the processing interval

View File

@ -192,7 +192,7 @@ protected:
/// This constructor is only meant to be called by derived classes. /// This constructor is only meant to be called by derived classes.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundStream(); SoundStream() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Define the audio stream parameters /// \brief Define the audio stream parameters

View File

@ -80,7 +80,7 @@ struct SFML_GRAPHICS_API BlendMode
/// Constructs a blending mode that does alpha blending. /// Constructs a blending mode that does alpha blending.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
BlendMode(); BlendMode() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the blend mode given the factors and equation. /// \brief Construct the blend mode given the factors and equation.

View File

@ -57,7 +57,7 @@ public:
/// \li a null shader /// \li a null shader
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderStates(); RenderStates() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a default set of render states with a custom blend mode /// \brief Construct a default set of render states with a custom blend mode

View File

@ -52,7 +52,7 @@ public:
/// use the other constructors or call create() to do so. /// use the other constructors or call create() to do so.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderWindow(); RenderWindow() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a new window /// \brief Construct a new window

View File

@ -92,7 +92,7 @@ public:
/// This constructor creates an invalid shader. /// This constructor creates an invalid shader.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader(); Shader() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Destructor /// \brief Destructor

View File

@ -47,13 +47,13 @@ public:
/// \brief Default constructor /// \brief Default constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Transformable(); Transformable() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Virtual destructor /// \brief Virtual destructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual ~Transformable(); virtual ~Transformable() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief set the position of the object /// \brief set the position of the object

View File

@ -52,7 +52,7 @@ public:
/// Creates an empty vertex array. /// Creates an empty vertex array.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
VertexArray(); VertexArray() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the vertex array with a type and an initial number of vertices /// \brief Construct the vertex array with a type and an initial number of vertices

View File

@ -72,7 +72,7 @@ public:
/// Creates an empty vertex buffer. /// Creates an empty vertex buffer.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
VertexBuffer(); VertexBuffer() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct a VertexBuffer with a specific PrimitiveType /// \brief Construct a VertexBuffer with a specific PrimitiveType

View File

@ -56,37 +56,37 @@ public:
/// Creates an empty packet. /// Creates an empty packet.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet(); Packet() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Virtual destructor /// \brief Virtual destructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual ~Packet(); virtual ~Packet() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Copy constructor /// \brief Copy constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet(const Packet&); Packet(const Packet&) = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Copy assignment /// \brief Copy assignment
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet& operator=(const Packet&); Packet& operator=(const Packet&) = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Move constructor /// \brief Move constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet(Packet&&) noexcept; Packet(Packet&&) noexcept = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Move assignment /// \brief Move assignment
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet& operator=(Packet&&) noexcept; Packet& operator=(Packet&&) noexcept = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Append data to the end of the packet /// \brief Append data to the end of the packet

View File

@ -67,7 +67,7 @@ public:
/// This constructor creates an empty string. /// This constructor creates an empty string.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
String(); String() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct from a single ANSI character and a locale /// \brief Construct from a single ANSI character and a locale

View File

@ -49,7 +49,7 @@ public:
/// This constructors initializes all members to 0. /// This constructors initializes all members to 0.
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
VideoMode(); VideoMode() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Construct the video mode with its attributes /// \brief Construct the video mode with its attributes

View File

@ -52,10 +52,6 @@ ALCdevice* captureDevice = nullptr;
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
SoundRecorder::SoundRecorder() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundRecorder::~SoundRecorder() SoundRecorder::~SoundRecorder()
{ {

View File

@ -47,10 +47,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
SoundStream::SoundStream() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundStream::~SoundStream() SoundStream::~SoundStream()
{ {

View File

@ -46,10 +46,6 @@ const BlendMode BlendMax(BlendMode::One, BlendMode::One, BlendMode::Max);
const BlendMode BlendNone(BlendMode::One, BlendMode::Zero, BlendMode::Add); const BlendMode BlendNone(BlendMode::One, BlendMode::Zero, BlendMode::Add);
////////////////////////////////////////////////////////////
BlendMode::BlendMode() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
BlendMode::BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation) : BlendMode::BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation) :
colorSrcFactor(sourceFactor), colorSrcFactor(sourceFactor),

View File

@ -44,10 +44,6 @@ const RenderStates RenderStates::Default(BlendMode(
BlendMode::Add)); BlendMode::Add));
////////////////////////////////////////////////////////////
RenderStates::RenderStates() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderStates::RenderStates(const Transform& theTransform) : transform(theTransform) RenderStates::RenderStates(const Transform& theTransform) : transform(theTransform)
{ {

View File

@ -36,10 +36,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
RenderWindow::RenderWindow() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderWindow::RenderWindow(VideoMode mode, const String& title, std::uint32_t style, const ContextSettings& settings) RenderWindow::RenderWindow(VideoMode mode, const String& title, std::uint32_t style, const ContextSettings& settings)
{ {

View File

@ -226,10 +226,6 @@ struct Shader::UniformBinder
}; };
////////////////////////////////////////////////////////////
Shader::Shader() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader::~Shader() Shader::~Shader()
{ {
@ -966,10 +962,6 @@ namespace sf
Shader::CurrentTextureType Shader::CurrentTexture; Shader::CurrentTextureType Shader::CurrentTexture;
////////////////////////////////////////////////////////////
Shader::Shader() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Shader::~Shader() = default; Shader::~Shader() = default;

View File

@ -32,14 +32,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
Transformable::Transformable() = default;
////////////////////////////////////////////////////////////
Transformable::~Transformable() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Transformable::setPosition(const Vector2f& position) void Transformable::setPosition(const Vector2f& position)
{ {

View File

@ -33,10 +33,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
VertexArray::VertexArray() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
VertexArray::VertexArray(PrimitiveType type, std::size_t vertexCount) : m_vertices(vertexCount), m_primitiveType(type) VertexArray::VertexArray(PrimitiveType type, std::size_t vertexCount) : m_vertices(vertexCount), m_primitiveType(type)
{ {

View File

@ -61,10 +61,6 @@ GLenum usageToGlEnum(sf::VertexBuffer::Usage usage)
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
VertexBuffer::VertexBuffer() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
VertexBuffer::VertexBuffer(PrimitiveType type) : m_primitiveType(type) VertexBuffer::VertexBuffer(PrimitiveType type) : m_primitiveType(type)
{ {

View File

@ -37,30 +37,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
Packet::Packet() = default;
////////////////////////////////////////////////////////////
Packet::~Packet() = default;
////////////////////////////////////////////////////////////
Packet::Packet(const Packet&) = default;
////////////////////////////////////////////////////////////
Packet& Packet::operator=(const Packet&) = default;
////////////////////////////////////////////////////////////
Packet::Packet(Packet&&) noexcept = default;
////////////////////////////////////////////////////////////
Packet& Packet::operator=(Packet&&) noexcept = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Packet::append(const void* data, std::size_t sizeInBytes) void Packet::append(const void* data, std::size_t sizeInBytes)
{ {

View File

@ -35,8 +35,6 @@
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "sfml-error", __VA_ARGS__)) #define LOGE(...) ((void)__android_log_print(ANDROID_LOG_INFO, "sfml-error", __VA_ARGS__))
LogcatStream::LogcatStream() = default;
std::streambuf::int_type LogcatStream::overflow(std::streambuf::int_type c) std::streambuf::int_type LogcatStream::overflow(std::streambuf::int_type c)
{ {
if (c == '\n') if (c == '\n')

View File

@ -44,7 +44,7 @@
class SFML_SYSTEM_API LogcatStream : public std::streambuf class SFML_SYSTEM_API LogcatStream : public std::streambuf
{ {
public: public:
LogcatStream(); LogcatStream() = default;
std::streambuf::int_type overflow(std::streambuf::int_type c) override; std::streambuf::int_type overflow(std::streambuf::int_type c) override;

View File

@ -37,10 +37,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
String::String() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
String::String(char ansiChar, const std::locale& locale) String::String(char ansiChar, const std::locale& locale)
{ {

View File

@ -34,10 +34,6 @@
namespace sf namespace sf
{ {
////////////////////////////////////////////////////////////
VideoMode::VideoMode() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
VideoMode::VideoMode(const Vector2u& modeSize, unsigned int modeBitsPerPixel) : VideoMode::VideoMode(const Vector2u& modeSize, unsigned int modeBitsPerPixel) :
size(modeSize), size(modeSize),

View File

@ -61,7 +61,7 @@ public:
/// Refer to sf::Cursor::Cursor(). /// Refer to sf::Cursor::Cursor().
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CursorImpl(); CursorImpl() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Destructor /// \brief Destructor

View File

@ -49,11 +49,6 @@ NSCursor* loadFromSelector(SEL selector)
namespace sf::priv namespace sf::priv
{ {
////////////////////////////////////////////////////////////
CursorImpl::CursorImpl() = default;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CursorImpl::~CursorImpl() CursorImpl::~CursorImpl()
{ {