[C++-sig] Re: Arbitrary argument lists, Python style?
David Abrahams
dave at boost-consulting.com
Mon Jul 28 21:45:20 CEST 2003
"Conan Brink" <conanb at STCG.net> writes:
> Forgive me if I'm just being dense, but in hours of searching multiple
> archives, I have not been able to find a way to implement the following
> Python code in C++ via BPL (simplified somewhat for purposes of this
> discussion):
>
>
>
> class BackCaller:
>
> def SetCallback(self, action, *args):
>
> self.cb = (action, args)
>
>
>
> def CallItBack(self):
>
> if self.cb:
>
> (action, args) = self.cb
>
> return action(*args)
>
>
>
> The thing that's causing me to pull foot-long hairs from my head is that
> little *args
Does http://tinyurl.com/ibc6 help?
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list