This is the mail archive of the
mailing list for the GDB project.
Re: [RFA 19/22] Convert tid_range_parser to class
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 11 Oct 2016 20:11:58 -0600
- Subject: Re: [RFA 19/22] Convert tid_range_parser to class
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com>
>>>>> "Pedro" == Pedro Alves <firstname.lastname@example.org> writes:
Pedro> Here's what I ended up with, after reading your version in more
Pedro> detail. That brought in the "deleted" copy
Pedro> constructor/assignment operators , and "const" in several
Pedro> methods, which I then propagated to number_or_range_parser too.
I'm sorry I didn't reply to this sooner.
This all looks good to me.
Pedro>  - I'm pondering making those use =delete if compiling with
Pedro> a C++ compiler, behind some
Pedro> #define DISABLE_COPY_AND_ASSIGN(TYPE) ...
Pedro> Or, maybe add a gdb::noncopyable class that non-copyable
Pedro> classes inherit from privately, just like boost:noncopyable.
Pedro> Anyone got experience on the latter, and whether that turns
Pedro> out to be a bad idea?
I haven't used that.
The Moz approach that Trevor mentioned seems reasonable.
Or, just switching to C++11, per the other thread, and using =delete.