]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbsupport/intrusive-list: make insert return an iterator
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 12 Aug 2024 17:09:03 +0000 (13:09 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 13 Sep 2024 11:38:56 +0000 (07:38 -0400)
commitd8ea57169cf9e4d2d6979e19902e283385a49d71
treed8f05d0c97db2104fc54b6f32e4f6ab94426cdb3
parent96917d0541db09977afaba3e6f8a53bfb31bcf45
gdbsupport/intrusive-list: make insert return an iterator

Make the insert method return an iterator to the inserted element.  This
mimics what boost does [1] and what the standard library insert methods
generally do [2].

[1] https://www.boost.org/doc/libs/1_79_0/doc/html/boost/intrusive/list.html#idm33771-bb
[2] https://en.cppreference.com/w/cpp/container/vector/insert

Change-Id: I59082883492c60ee95e8bb29a18c9376283dd660
Reviewed-by: Keith Seitz <keiths@redhat.com>
gdb/unittests/intrusive_list-selftests.c
gdbsupport/intrusive_list.h