This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: list::_M_check_equal_allocators throws
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 17 Sep 2013 16:11:12 +0100
- Subject: Re: list::_M_check_equal_allocators throws
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1309171540430 dot 11436 at stedding dot saclay dot inria dot fr>
On 17 September 2013 14:57, Marc Glisse wrote:
> Hello,
>
> I noticed that std::list::_M_check_equal_allocators throws an exception when
> the allocators should be equal but they are not. This prevents from marking
> splice noexcept (well, technically we still could, but...).
>
> Debug mode, when it detects an error, prints a diagnostic and aborts. Should
> this list check do the same? It looks more like a logic error than a runtime
> error to me.
I agree that std::logic_error would have made more sense than
std::runtime_error, but as it's undefined behaviour anyway I'd be
happy to just terminate there too. I don't have a strong preference.