Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2008-07-11 19:21:58


on Fri Jul 11 2008, Simon Pickles <sipickles-AT-googlemail.com> wrote:
>>
> I was hoping to be able to call one function with different args,
> wrapping those args somehow.
>
> In python, I could call a function with a list, dict or tuple. Since
> this one object was the argument, it didn't matter what it contained.
>
> I know I could pass a vector in C++, but this needs a single data
> type. In python I could call:
>
> MyFunc((1, "2", anObject)) # - all in a tuple
> MyFunc(("aardvark", 42)) # another tuple
>
> Anyway to replicate this very convenient functionality?

Make MyFunc a function template and use Boost.Range?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net