Skip to content

Commit

Permalink
Move 'immovable' to test_types.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jiixyj committed Jan 3, 2025
1 parent fa14f9d commit e280641
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/beman/optional26/tests/optional.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,7 @@ TEST(OptionalTest, HashTest) {
}

TEST(OptionalTest, CanHoldValueOfImmovableType) {
struct immovable {
explicit immovable() = default;
immovable(const immovable&) = delete;
immovable& operator=(const immovable&) = delete;
};
using beman::optional26::tests::immovable;

beman::optional26::optional<immovable> o1(beman::optional26::in_place);
EXPECT_TRUE(o1);
Expand Down
6 changes: 6 additions & 0 deletions src/beman/optional26/tests/test_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class Point {
bool operator==(const Point&) const = default;
};

struct immovable {
explicit immovable() = default;
immovable(const immovable&) = delete;
immovable& operator=(const immovable&) = delete;
};

} // namespace beman::optional26::tests

#endif // BEMAN_OPTIONAL26_TESTS_TEST_TYPES_HPP

0 comments on commit e280641

Please sign in to comment.