Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1445,15 +1445,12 @@
that of every integral type of the same signedness.

\pnum
A type \tcode{I} other than \cv{}~\tcode{bool} is \defn{integer-like}
if it models \tcode{\libconcept{integral}<I>} or
if it is an integer-class type.
An integer-like type \tcode{I} is \defn{signed-integer-like}
if it models \tcode{\libconcept{signed_integral}<I>} or
if it is a signed-integer-class type.
An integer-like type \tcode{I} is \defn{unsigned-integer-like}
if it models \tcode{\libconcept{unsigned_integral}<I>} or
if it is an unsigned-integer-class type.
Integer-class types and integral types\iref{basic.fundamental} other than \cv{}~\tcode{bool}
are collectively called \defnadjx{integer-like}{types}{type}.
Signed-integer-class types and types that model \tcode{\libconcept{signed_integral}}
are collectively called \defnadjx{signed-integer-like}{types}{type}.
Unsigned-integer-class types, and types other than \cv{}~\tcode{bool} that model \tcode{\libconcept{unsigned_integral}},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this "bool" exclusion coming from? It's not in the original text for unsigned-integer-like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original text is

An integer-like type I is unsigned-integer-like if it models unsigned_integral<I> or if it is an unsigned-integer-class type.

Now, is bool an unsigned-integer-like type? Arguably the reader can't use the original sentence to say one way or the other, since the original sentence tells us anything at all only for "an integer-like type," which bool isn't.

But the intent, I think, is that the unsigned-integer-like types should be a strict subset of the integer-like types.

Suppose the new text was:

Unsigned-integer-class types, and types other than cv bool that model unsigned_integral, are collectively called unsigned-integer-like types.

Then bool (which models unsigned_integral) would be considered unsigned-integer-like but not integer-like. I'm sure we don't intend that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, how about this? (Signed-integer-class types and unsigned-integer-class types are collectively known as integer-class types: [iterator.concept.winc]/3.)

Signed-integer-class types and types that model \tcode{\libconcept{signed_integral}}
are collectively called \defnadjx{signed-integer-like}{types}{type}.
Unsigned-integer-class types, and types other than \cv{}~\tcode{bool} that model \tcode{\libconcept{unsigned_integral}},
are collectively called \defnadjx{unsigned-integer-like}{types}{type}.
Signed-integer-like types and unsigned-integer-like types
are collectively called \defnadjx{integer-like}{types}{type}.

This puts the "except bool" exception in just one place instead of two, and makes it very clear that integer-like types are precisely partitioned into signed and unsigned just like integer-class types are partitioned into signed and unsigned and integral types are partitioned into signed and unsigned.

are collectively called \defnadjx{unsigned-integer-like}{types}{type}.

\pnum
For every integer-class type \tcode{I},
Expand Down