Skip to content

Commit 5b11795

Browse files
authored
Merge pull request #4 from jay-tux/fix/generator
Fix/generator
2 parents 27c2a1b + 57942ea commit 5b11795

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

inc/generator.hpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,33 @@ template <std::copyable T> class generator {
250250
* \param[in] p The promise to use.
251251
*/
252252
generator(promise_type &p) : _h{handle_type::from_promise(p)} {}
253+
254+
/**
255+
* \brief Copy-constructing generators results in undefined behaviour.
256+
*/
257+
generator(const generator &other) = delete;
258+
/**
259+
* \brief Moves the data from the other generator into this one.
260+
* \param[in,out] other The other generator.
261+
*/
262+
generator(generator &&other) = default;
263+
264+
/**
265+
* \brief Copy-assigning generators results in undefined behaviour.
266+
*/
267+
generator &operator=(const generator &other) = delete;
268+
/**
269+
* \brief Moves the data from the other generator into this one.
270+
* \param[in,out] other The other generator.
271+
* \returns A reference to this generator.
272+
*/
273+
generator &operator=(generator &&other) = default;
274+
275+
/**
276+
* \brief Cleans up this generator's resources.
277+
*/
278+
~generator() = default;
279+
253280
/**
254281
* \brief Converts this generator its handle.
255282
* \returns The handle for this generator.

test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dirs:
1414

1515
$(BIND)/generator: $(OBJD)/generator/test_generator.o
1616
$(CC) $< $(LDXTRA) $(LDARGS) -o $@
17-
$(BIND)/generator
17+
$(BIND)/generator --gtest_output="xml:$(BIND)/"
1818

1919
$(OBJD)/%.o: $(SRCD)/%.cpp Makefile
2020
$(CC) $(CXXARGS) $(CXXXTRA) $< -o $@

0 commit comments

Comments
 (0)