Weird way of forbidding copying

14 views
Skip to first unread message

Mark Rotteveel

unread,
Jul 19, 2025, 9:17:09 AMJul 19
to firebir...@googlegroups.com
In common/classes/alloc.h, I see

```
private:
// Forbid copying/assignment
MemoryStats(const MemoryStats&);
MemoryStats& operator=(const MemoryStats&);
```

Shouldn't that just be (in public?):

```
MemoryStats(const MemoryStats&) = delete;
MemoryStats& operator=(const MemoryStats&) = delete;
```

Or am I missing something?

Mark
--
Mark Rotteveel

Роман Симаков

unread,
Jul 19, 2025, 9:21:16 AMJul 19
to firebir...@googlegroups.com
It's an old stype. =delete is available since C++11
 
----------------
Тема: [firebird-devel] Weird way of forbidding copying;
19.07.2025, 16:17, "'Mark Rotteveel' via firebird-devel" <firebir...@googlegroups.com>:
--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/firebird-devel/52b8567a-86cf-4b57-b96b-0541b13d591f%40lawinegevaar.nl.

Dimitry Sibiryakov

unread,
Jul 19, 2025, 9:21:19 AMJul 19
to firebir...@googlegroups.com
'Mark Rotteveel' via firebird-devel wrote 19.07.2025 15:17:
> Or am I missing something?

This is an old file, from the era where deleted constructors weren't
available. Feel free to modernize the code if you wish.

--
WBR, SD.

Mark Rotteveel

unread,
Jul 19, 2025, 9:30:44 AMJul 19
to firebir...@googlegroups.com
On 19/07/2025 15:21, Роман Симаков wrote:
> It's an old stype. =delete is available since C++11

Right, thanks!

Mark

--
Mark Rotteveel
Reply all
Reply to author
Forward
0 new messages