Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

missing description : error_category's destructor

54 views
Skip to first unread message

Akira Takahashi

unread,
Mar 20, 2012, 2:22:55 AM3/20/12
to
Hi,

I found missing description. N3337 19.5.1.1 error_category:
virtual ~error_category() noexcept;

This function is nothing description.

Correct code is follow?
virtual ~error_category() noexcept = default;

Thanks,
Akira


--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp...@vandevoorde.com ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Daniel Krügler

unread,
Mar 21, 2012, 11:42:17 AM3/21/12
to
On 2012-03-20 07:22, Akira Takahashi wrote:
> I found missing description. N3337 19.5.1.1 error_category:
> virtual ~error_category() noexcept;
>
> This function is nothing description.

I agree, because a virtual destructor is not covered by the general
statement in [functions.within.classes] p1.

> Correct code is follow?
> virtual ~error_category() noexcept = default;

Except for the explicit noexcept specification, yes. There is a general
normative statement in [res.on.exception.handling] p4

"Every destructor in the C++ standard library shall behave as if it had
a non-throwing exception specification."

which rules this already. This is the reason why *no* destructor
declaration in the library specification does have any noexcept
specification. Adding this suddenly at one place would make give the
impression that we have a special case here.

HTH& Greetings from Bremen,

Daniel Krügler

Akira Takahashi

unread,
Mar 21, 2012, 2:36:15 PM3/21/12
to
> > I found missing description. N3337 19.5.1.1 error_category:
> > virtual ~error_category() noexcept;
>
> > This function is nothing description.
>
> I agree, because a virtual destructor is not covered by the general
> statement in [functions.within.classes] p1.
>
> > Correct code is follow?
> > virtual ~error_category() noexcept = default;
>
> Except for the explicit noexcept specification, yes. There is a general
> normative statement in [res.on.exception.handling] p4
>
> "Every destructor in the C++ standard library shall behave as if it had
> a non-throwing exception specification."
>
> which rules this already. This is the reason why *no* destructor
> declaration in the library specification does have any noexcept
> specification. Adding this suddenly at one place would make give the
> impression that we have a special case here.
>
> HTH& Greetings from Bremen,
>
> Daniel Krügler
>

Oh, your right.
I get new knowledge. Thanks.

Summary, should change:

virtual ~error_category() = default;

or add description:

"Effects: Destroys an object of class error_category."

Thanks,
Akira
0 new messages