octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ string::find functions and size_t


From: Mike Miller
Subject: Re: C++ string::find functions and size_t
Date: Fri, 27 Feb 2015 13:17:36 -0500

On Fri, Feb 27, 2015 at 09:47:17 -0800, rik wrote:
> Final question on this topic.  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.  Should
> we care about this?  The gl2ps-render.cc code, that maybe we got from
> somewhere else originally, does use std::size_t.

Yes, this is absolutely safe. Note that std::string::size_type is in
fact the same as std::size_t according to the standard. It's
std::basic_string<c,t,a>::size_type that may differ from std::size_t.

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]