Skip to content

Can we have an automatically disconnecting 'RAII connection', equivalent of boost::signals2::scoped_connection? #87

Closed
@db-src

Description

@db-src

I have a few times wanted a connection that automatically disconnect()s itself when it goes out of scope and is destructed, via RAII.

boost::signals2 offers this:

boost::signals2::scoped_connection — Limits a signal-slot connection lifetime to a particular scope.

It would be handy if we had the same here, not only because it's useful, but also because I believe sigc++ was at one point based on the original boost::signals (?) and is at the outline level mostly compatible, perhaps with small changes... so this would hopefully be only a small bit of work to bring us up to feature par with it.

Would it be possible therefore for us to get a sigc::scoped_connection or similar?

If yes, I should be able to look at developing this, unless someone else wants to. :-)

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions