Re: Controlling the hardware volume
- From: Chris Vine <chris cvine freeserve co uk>
- To: José Alburquerque <jaalburquerque cox net>
- Cc: gtkmm-list gnome org
- Subject: Re: Controlling the hardware volume
- Date: Wed, 25 Nov 2009 10:24:59 +0000
On Wed, 25 Nov 2009 01:04:06 -0500
José Alburquerque <jaalburquerque cox net> wrote:
> On Tue, 2009-11-24 at 17:05 -0500, José Alburquerque wrote:
> > The problem is that your trying to initialize a Glib::RefPtr<>&
> > from a Glib::RefPtr<> (which the std::list<> contains). A
> > std::list<> is not designed to store references.
>
> It doesn't seem clear what I was trying to say about lists not
> "storing" references. I guess what I was trying to say is that I
> think trying to extract a reference by dereferencing a
> list<>::iterator is not doable. I was also trying to suggest another
> way get at the contents of the list.
You would expect std::list<T>::iterator::operator*() to return a
reference rather than a value type (it does on my version of libstdc++),
so it shouldn't fall foul of the preclusion of binding a temporary to a
non-const reference.
Isn't the explanation simply that Glib::RefPtr<Gst::MixerTrack> and
Glib::RefPtr<Gst::MixerTrack const> are different types (as they are)?
Glib::RefPtr<Gst::MixerTrack const> track = *iter (ie instantiating a
new RefPtr object rather than a reference) should work because it will
cause the templated version of the RefPtr's copy constructor to be
invoked, which will allow implicit conversion of the RefPtr's value
type.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]