Topic: size_t and valarray [g]slices strides


Author: Christian Millour <chris161@mailhost.grolier.fr>
Date: 1997/03/19
Raw View
concerning dec96wp 26.3.4 [lib.class.slice] and followers

why is the stride represented using (interfaced as) size_t ?

I couldn't find a requirement in the draft that size_t should be
unsigned, however this is the case in all the compilers I use.

IMHO signed strides would be more appropriate as they allow for
easy "mirroring" (e.g. displacing the logical origin of a 2D array
from top-left to bottom-right)

TIA.
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: Stephen.Clamage@Eng.Sun.COM (Steve Clamage)
Date: 1997/03/19
Raw View
In article 5807C0@mail.club-internet.fr, Christian Millour <chris161@mailhost.grolier.fr> writes:
>
>I couldn't find a requirement in the draft that size_t should be
>unsigned, however this is the case in all the compilers I use.

Section 18.1 of the draft says size_t in C++ has the same requirements
as in C. The C standard says it must be unsigned.

---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]