Created on 2018-12-11.00:00:00 last changed 36 months ago
Additional note (August, 2022):
If there are concerns about reuse of tail padding in #1, requiring a copy for some implementation reason, similar concerns should apply to #2 if the data member is declared with [[no_unique_address]].
Furthermore, the following example using a delegating constructor shows implementation divergence:
struct Noncopyable {
Noncopyable();
Noncopyable(const Noncopyable &) = delete;
Noncopyable(int) : Noncopyable(Noncopyable()) {} // #3?
};
Given the following example,
struct Noncopyable {
Noncopyable();
Noncopyable(const Noncopyable &) = delete;
};
Noncopyable make(int kind = 0);
struct AsBase : Noncopyable {
AsBase() : Noncopyable(make()) {} // #1
};
struct AsMember {
Noncopyable nc;
AsMember() : nc(make()) { } // #2?
};
All implementations treat #1 as an error, invoking the deleted copy constructor, while #2 is accepted. It's not clear from the current wording why they should be treated differently.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-11-25 07:46:02 | admin | set | status: open -> drafting |
| 2022-08-23 21:19:27 | admin | set | messages: + msg6897 |
| 2018-12-11 00:00:00 | admin | create | |