This is the mail archive of the
mailing list for the libstdc++ project.
Re: std::string<ThrowOnCopy> behavior
thank you for the answer, this helps me a lot.
On 04/14/2017 10:13 PM, Tim Song wrote:
> On Fri, Apr 14, 2017 at 9:07 AM, Ivan Baravy <email@example.com> wrote:
>> I attached an example where I expect an exception on the line 77, but
>> nothing happens. GDB reports that memmove is used and thus the
>> ThrowOnCopy objects are moved inside of a std::string and no exceptions
>> are thrown.
>> Is this behavior intentional?
> This Clause describes components for manipulating sequences of any
> non-array POD type. Such types are called char-like types, and objects
> of char-like types are called char-like objects or simply characters.
> Your ThrowOnCopy isn't a POD. PODs don't throw exceptions when copied.