SL-20546: Even with C++17 CTAD, makeClassicCallback() still useful.

meow-7.2.2
Nat Goodspeed 2023-11-15 11:10:42 -05:00
parent d427d5dbfa
commit 1c71a8e78e
1 changed files with 5 additions and 5 deletions

View File

@ -119,11 +119,11 @@ public:
* ClassicCallback must not itself be copied or moved! Once you've passed
* get_userdata() to some API, this object MUST remain at that address.
*/
// However, we can't yet count on C++17 Class Template Argument Deduction,
// which means makeClassicCallback() is still useful, which means we MUST
// be able to return one to construct into caller's instance (move ctor).
// Possible defense: bool 'referenced' data member set by get_userdata(),
// with an llassert_always(! referenced) check in the move constructor.
// However, makeClassicCallback() is useful for deducing the CALLABLE
// type, which means we MUST be able to return one to construct into
// caller's instance (move ctor). Possible defense: bool 'referenced' data
// member set by get_userdata(), with an llassert_always(! referenced)
// check in the move constructor.
ClassicCallback(ClassicCallback const&) = delete;
ClassicCallback(ClassicCallback&&) = default; // delete;
ClassicCallback& operator=(ClassicCallback const&) = delete;