https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #8 from 康桓瑋 ---
(In reply to Jonathan Wakely from comment #4)
> Maybe you could legally do:
>
> using difference_type = iterator_t>;
>
> but maybe just don't do that. If things break when you do dumb things, don't
> do those
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #6 from CVS Commits ---
The master branch has been updated by Jonathan Wakely :
https://gcc.gnu.org/g:9cce91a63dcc40cb39e68f6a771e891e51c51946
commit r13-4527-g9cce91a63dcc40cb39e68f6a771e891e51c51946
Author: Jonathan Wakely
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #5 from 康桓瑋 ---
(In reply to Jonathan Wakely from comment #4)
> Maybe you could legally do:
>
> using difference_type = iterator_t>;
>
> but maybe just don't do that. If things break when you do dumb things, don't
> do those
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #4 from Jonathan Wakely ---
Maybe you could legally do:
using difference_type = iterator_t>;
but maybe just don't do that. If things break when you do dumb things, don't do
those things.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #3 from Jonathan Wakely ---
No. They are only allowed to be implementation-defined types, not
program-defined types.
I can add the casts to make this work, but I don't think it's a real problem
that can occur in valid programs.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #2 from 康桓瑋 ---
This is just an example. So, are users not allowed to define integer-like class
types?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107871
--- Comment #1 from Jonathan Wakely ---
This isn't valid code, you can't use max diff type for your own types. It can
only be used by the library for iota_view, but that doesn't have output
iterators.