Skip to content

Commit

Permalink
fix: explicitly add/delete constructors and assignment operators
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrechette committed Sep 19, 2023
1 parent a3150e4 commit ce28378
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/rtm/impl/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ RTM_IMPL_FILE_PRAGMA_PUSH

class runtime_assert final : public std::runtime_error
{
runtime_assert() = delete; // Default constructor not needed

using std::runtime_error::runtime_error; // Inherit constructors
};

Expand Down
24 changes: 24 additions & 0 deletions includes/rtm/impl/matrix_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ namespace rtm
struct matrix_caster<matrix3x3f>
{
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(const matrix3x3f& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(matrix3x3f&& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}

matrix_caster(const matrix_caster&) = default;
matrix_caster& operator=(const matrix_caster&) = delete;

RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr RTM_SIMD_CALL operator matrix3x3f() const RTM_NO_EXCEPT
{
Expand Down Expand Up @@ -88,6 +92,10 @@ namespace rtm
struct matrix_caster<matrix3x3d>
{
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(const matrix3x3d& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(matrix3x3d&& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}

matrix_caster(const matrix_caster&) = default;
matrix_caster& operator=(const matrix_caster&) = delete;

RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE RTM_SIMD_CALL operator matrix3x3f() const RTM_NO_EXCEPT
{
Expand Down Expand Up @@ -128,6 +136,10 @@ namespace rtm
struct matrix_caster<matrix3x4f>
{
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(const matrix3x4f& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(matrix3x4f&& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}

matrix_caster(const matrix_caster&) = default;
matrix_caster& operator=(const matrix_caster&) = delete;

RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr RTM_SIMD_CALL operator matrix3x3f() const RTM_NO_EXCEPT
{
Expand Down Expand Up @@ -170,6 +182,10 @@ namespace rtm
struct matrix_caster<matrix3x4d>
{
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(const matrix3x4d& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(matrix3x4d&& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}

matrix_caster(const matrix_caster&) = default;
matrix_caster& operator=(const matrix_caster&) = delete;

RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE RTM_SIMD_CALL operator matrix3x3f() const RTM_NO_EXCEPT
{
Expand Down Expand Up @@ -212,6 +228,10 @@ namespace rtm
struct matrix_caster<matrix4x4f>
{
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(const matrix4x4f& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(matrix4x4f&& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}

matrix_caster(const matrix_caster&) = default;
matrix_caster& operator=(const matrix_caster&) = delete;

RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr RTM_SIMD_CALL operator matrix3x3f() const RTM_NO_EXCEPT
{
Expand Down Expand Up @@ -250,6 +270,10 @@ namespace rtm
struct matrix_caster<matrix4x4d>
{
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(const matrix4x4d& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}
RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE constexpr explicit matrix_caster(matrix4x4d&& mtx_) RTM_NO_EXCEPT : mtx(mtx_) {}

matrix_caster(const matrix_caster&) = default;
matrix_caster& operator=(const matrix_caster&) = delete;

RTM_DISABLE_SECURITY_COOKIE_CHECK RTM_FORCE_INLINE RTM_SIMD_CALL operator matrix3x3f() const RTM_NO_EXCEPT
{
Expand Down

0 comments on commit ce28378

Please sign in to comment.