Skip to content

Commit c5976e4

Browse files
committed
Delete copy constructors & operators
1 parent ffa8dfa commit c5976e4

16 files changed

+285
-113
lines changed

include/ldtk_definitions.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ class definitions
2828
}
2929
/// @endcond
3030

31+
/// @brief Deleted copy constructor.
32+
constexpr definitions(const definitions&) = delete;
33+
34+
/// @brief Deleted copy assignment operator.
35+
constexpr definitions& operator=(const definitions&) = delete;
36+
37+
/// @brief Defaulted move constructor.
38+
constexpr definitions(definitions&&) = default;
39+
40+
/// @brief Defaulted move assignment operator.
41+
constexpr definitions& operator=(definitions&&) = default;
42+
3143
public:
3244
/// @brief Looks up a entity definition with its identifier.
3345
/// @note Look-up is done via indexing, thus it's O(1).

include/ldtk_entity.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ class entity
3030
}
3131
/// @endcond
3232

33+
/// @brief Deleted copy constructor.
34+
constexpr entity(const entity&) = delete;
35+
36+
/// @brief Deleted copy assignment operator.
37+
constexpr entity& operator=(const entity&) = delete;
38+
39+
/// @brief Defaulted move constructor.
40+
constexpr entity(entity&&) = default;
41+
42+
/// @brief Defaulted move assignment operator.
43+
constexpr entity& operator=(entity&&) = default;
44+
3345
public:
3446
/// @brief Looks up a field with its identifier.
3547
/// @note Look-up is done via indexing, thus it's O(1). \n

include/ldtk_entity_definition.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ class entity_definition
3939
}
4040
/// @endcond
4141

42+
/// @brief Deleted copy constructor.
43+
constexpr entity_definition(const entity_definition&) = delete;
44+
45+
/// @brief Deleted copy assignment operator.
46+
constexpr entity_definition& operator=(const entity_definition&) = delete;
47+
48+
/// @brief Defaulted move constructor.
49+
constexpr entity_definition(entity_definition&&) = default;
50+
51+
/// @brief Defaulted move assignment operator.
52+
constexpr entity_definition& operator=(entity_definition&&) = default;
53+
4254
public:
4355
/// @brief Pixel size
4456
[[nodiscard]] constexpr auto size() const -> const bn::size&

0 commit comments

Comments
 (0)