C++ Logo

std-discussion

Advanced search

Re: Noexcept specification of basic_string's move assignment operator in C++11 and C++14

From: Gennaro Prota <gennaro.prota_at_[hidden]>
Date: Fri, 21 Feb 2020 10:59:27 +0100
On Fri, Feb 21, 2020 at 10:38 AM Daniel Krügler
<daniel.kruegler_at_[hidden]> wrote:
>
> Am Fr., 21. Feb. 2020 um 09:55 Uhr schrieb Gennaro Prota
> <gennaro.prota_at_[hidden]>:
> >
> > On Fri, Feb 21, 2020 at 9:29 AM Daniel Krügler
> > <daniel.kruegler_at_[hidden]> wrote:
> > >
> > > Am Fr., 21. Feb. 2020 um 08:40 Uhr schrieb Gennaro Prota via
> > > Std-Discussion <std-discussion_at_[hidden]>:
> > > >
> > > > Hi,
> > > >
> > > > considering all the applicable defect reports (in particular, LWG 2063),
> > > > what noexcept specification, if any, is basic_string's move assignment
> > > > operator supposed to have in C++11 and C++14?
> > >
> > > LWG 2063 is a defect report against C++17, so I'm unsure how to
> > > interpret your question.
> >
> > Hmm. Are you sure?
>
> Yes, the issue has status C++17, which is defined (follow the link) as:
>
> "C++17 - (C++ Standard, as revised for 2017) - The full WG21/PL22.16
> committee has voted to accept the Defect Report's Proposed Resolution
> into the published 2017 revision to the C++ standard, ISO/IEC IS
> 14882:2017(E)."

OK. Can we say it was *against* C++11 but then it was only resolved for
C++17?

> > The issue was filed in 2011
>
> The date when an issue was created is not necessarily related to the
> C++ standard it will be agreed being fixed. Of-course a C++-Compiler
> vendor could decide to consider such a bug fix as something she wishes
> to backport to older standards.

But what is, *formally*, the situation? That C++11 and C++14 remain
buggy and that an implementation which applies a fix is non-conforming?

That is, must the operator be noexcept( true ) in C++11 and C++14?

> > and Cppreference says it
> > was applied to C++11:
> >
> > <https://en.cppreference.com/mwiki/index.php?title=cpp/string/basic_string/operator%3D&oldid=107712>.
> >
> > See also the talk page:
> >
> > <https://en.cppreference.com/mwiki/index.php?title=Talk:cpp/string/basic_string/operator%3D&oldid=103483>.
>
> None of these links represent the C++ committee, so I don't consider
> this information as binding.

Yeah. I'm the first one to say that Cppreference is not a primary source
and all that. But they are usually right, and know the standardization
bureaucracy better than me, so I was in doubt.

-- 
--
.:: Gennaro Prota ::.
.:: https://about.me/gennaro.prota ::.

Received on 2020-02-21 04:02:45