Skip to content

[dcl.dcl] Consider using less awkward example to illustrate static_assert #1514

@Eelis

Description

@Eelis

[dcl.dcl]/6 uses the following example to demonstrate the use of static_assert:

static_assert(char(-1) < 0, "this library requires plain 'char' to be signed");

Perhaps this not the best example to use, since a test for signedness of char would probably be more idiomatically expressed using std::is_signed_v. Of course, since this is a core chapter, we may not want to use std::is_signed_v, but I suspect one could come up with an example static_assert that is illustrative, idiomatic, and does not use the stdlib.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions