[sigc] sigc::group composition for no-parameter functors?



i all,

So, I found myself trying to write the most convoluted lambda
exploiting code possible today and I ran into a couple of
limitations. :-) Don't worry, this is purely for my own
edification - I don't have a requirement for anything this
over the top. :-)

1) There's no way to compose a zero-parameter functor into
a sigc::group call. I ended up doing:

sigc::group(sigc::hide(&foo), sigc::_1) to achive the desired
effect.

2) It doesn't seem to be possible to do the following or an equivalent:

void foo(char a, int b, bool c);
void bar(sigc::slot<char> baz, int d);

sigc::group(sigc::ptr_fun(&bar),
            sigc::bind(sigc::ptr_fun(&foo),
                       sigc::_1, sigc::_2),
            sigc::_3)(1, true, 3);

So, I want to bind the selectors as specific parameters
but leave the rest untouched so the final slot conforms
to the expected signature.

I can't use sigc::group because it doesn't seem to support binding
the selector to a specific parameter and sigc::bind doesn't understand
a selector if one is passed instead of an actual value.

Yes, it's all very silly, but if we've gone this far... :-)

--phil







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]