[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ string::find functions and size_t
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: C++ string::find functions and size_t |
Date: |
Fri, 27 Feb 2015 13:52:42 -0500 |
On Fri, 2015-02-27 at 09:47 -0800, rik wrote:
> According to the C++ reference, the find functions actually return
> an object of std::string::size_type. Normally, maybe even
> definitionally, this is the same as std::size_t. Octave code,
> however, assumes that the bare size_t is the same as std::size_t.
::size_t is inherited from C and it's the type of the sizeof()
operator, while std::size_t is, according to gospel, "an
implementation-defined unsigned integer type that is large enough to
contain the size in bytes of any object."
I don't see how these two things can be different, and they certainly
are not in the gcc implementation.
- Jordi G. H.