From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Use an std::vector for inline_states
Date: Mon, 09 Apr 2018 09:10:00 -0000 [thread overview]
Message-ID: <5d1e75f3-6f53-9da8-ffe5-95ef6d7795ee@redhat.com> (raw)
In-Reply-To: <3d8cc397-b7d5-b705-bf5f-8eff154eb587@redhat.com>
Hi,
I remembered now that I forgot so point at something that I had wanted
to mention before.
It's that I think that this:
> +template <typename T>
> +T
> +unordered_remove (std::vector<T> &vec, typename std::vector<T>::iterator it)
> +{
won't work as is with gdb::def_vector/gdb::byte_vector, because the above
assumes std::vector has a single template parameter, while in reality it
has two.
I think this can either be fixed by adding an allocator template parameter
to unordered_remove:
template<typename T, typename A>
void
unordered_erase (std::vector<T, A> &v,
typename std::vector<T, A>::iterator pos)
or by making the whole vector/container type a template like in
my example:
template<typename Vector>
void
unordered_erase (Vector &v, typename Vector::iterator pos)
Thanks,
Pedro Alves
next prev parent reply other threads:[~2018-04-09 9:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 14:42 Simon Marchi
2018-04-07 19:28 ` Pedro Alves
2018-04-07 21:13 ` Simon Marchi
2018-04-07 23:21 ` Simon Marchi
2018-04-08 17:29 ` Pedro Alves
2018-04-09 9:10 ` Pedro Alves [this message]
2018-04-09 19:45 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d1e75f3-6f53-9da8-ffe5-95ef6d7795ee@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox