wx-u...@googlegroups.com wrote on 09.06.2022 07:27:58:
> In particular, in wxArrayString's documentation [
docs.wxwidgets.org]
> there is no mention of the method named back but I am still able to use
back
> as shown below. In the documentation only the Last method is
> mentioned but not the back method. Why is this?
>
> wxFileName dirname( dialog.GetPath(), "" );
> lastPart = dirname.GetDirs().back(); //this works but documentation
> has no back method
>
> As you can see I am able to use the `back` method even though there
> is no back method mentioned in the documentation of wxArrayString.
> Is the back method inherited from wxArray or something else.
Hi Sean,
back() and Last() are both implemented directly in wxArrayString. Have a
look at arrstr.h if you like.
back() (and other functions like begin(), erase() etc.) mimic the
interface of C++ STL containers.
In fact if you did not change the compiler flag
wxUSE_STD_CONTAINERS_COMPATIBLY to 0 (default=1), wxArrayStrings are even
actually STL containers under the hood.
So by stating that wxArrayString can be used like an STL container, having
functions like back() etc. is to be expected.
However, Last() is an wxWidgets addition to the interface and therefore
worth mentioning in the documentation.
Have a look at this link:
https://docs.wxwidgets.org/3.1/overview_container.html
- David
> On Thu, 9 Jun 2022 at 00:57, Gunter Königsmann
<
gunter.ko...@gmail.com
> > wrote:
> You can use wxFilename's method getdirs() for this.
>
> Kind regards,
> Gunter
> --
> Please read
https://www.wxwidgets.org/support/mlhowto.htm
[
wxwidgets.org]
> before posting.
> ---
> You received this message because you are subscribed to the Google
> Groups "wx-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
wx-users+u...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/
> d/msgid/wx-users/
> CADD_VSQY4nLHFiGtUyvT8HFiN20mBsUhgfSKsJUSE4suDRjpYA%
40mail.gmail.com
> [
groups.google.com].