On 20 déc, 12:26, Philipp Kraus <philipp.kr...@flashpixx.de> wrote:
> On 2010-12-18 20:53:14 +0100, Ian Collins said:
>
> > On 12/19/10 07:31 AM, Philipp Kraus wrote:
> >> Hello,
>
> >> is there a signed datatype like the unsigned std::size_t? I think
> >> std:
trdiff_t is for pointer arithmetics. I need a type with the same
> >> size but like a signed datatype.
>
> > POSIX defines ssize_t, other systems may also have it. *Other wise
> > define your own.
>
> Thanks for that answer. I know that POSIX defines this, but my code is
> for cross-plattform, so I can't use the POSIX definition. I think I
> will define my own type
If your compilers supports some C++0x features, you can define:
typedef std::make_signed<size_t>::type ssize_t;
Or roll your own make_signed<>.
--
Michael