[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ string::find functions and size_t
From: |
rik |
Subject: |
Re: C++ string::find functions and size_t |
Date: |
Fri, 27 Feb 2015 16:32:34 -0800 |
On 02/27/2015 10:52 AM, Jordi GutiƩrrez Hermoso wrote:
> 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.
I made all of our uses consistent by just using the bareword size_t in this
cset (http://hg.savannah.gnu.org/hgweb/octave/rev/d575cd1e0da7).
--Rik