What was called the generic copy constructor and assignment operator
are in fact constructor templates, not true copy operations.
This is because C++ requires that a copy constructor/assignment operator
be a "non-template non-static member function".
This patch is not a fix because the generated default copy operations
were fine (just copy the underlying libbabeltrace2 pointer). Just use
the default ones explicitly and fix the comments so that we know what's
going on.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I4b4f19416a78ca05eaf3fa92f85f9637b2be2c0a
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8090
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10801
Tested-by: jenkins <jenkins@lttng.org>
/*
* This makes it possible for a `BorrowedObj<const bt_something>`
* instance to get assigned an instance of
/*
* This makes it possible for a `BorrowedObj<const bt_something>`
* instance to get assigned an instance of
- * `BorrowedObj<bt_something>` (copy constructor and assignment
+ * `BorrowedObj<bt_something>` ("copy" constructor and "assignment"
* operator).
*
* C++ forbids the other way around.
* operator).
*
* C++ forbids the other way around.
+ /* Default copy operations */
+ BorrowedObj(const BorrowedObj&) noexcept = default;
+ BorrowedObj& operator=(const BorrowedObj&) noexcept = default;
+
- * Generic copy constructor.
+ * Generic "copy" constructor.
*
* This converting constructor accepts both an instance of
* `_ThisBorrowedObj` and an instance (`other`) of
*
* This converting constructor accepts both an instance of
* `_ThisBorrowedObj` and an instance (`other`) of
- * Generic assignment operator.
+ * Generic "assignment" operator.
*
* This operator accepts both an instance of
* `_ThisBorrowedObj` and an instance (`other`) of
*
* This operator accepts both an instance of
* `_ThisBorrowedObj` and an instance (`other`) of