Boost logo

Boost Users :

Subject: Re: [Boost-users] Expand tuple values as callable arguments
From: Joel de Guzman (joel_at_[hidden])
Date: 2009-06-09 11:32:46


Dominique Devienne wrote:
> Given a boost::tuple<A,B,C> abc; is there a boost facility that allows
> to "expand" abc into its a, b, c values to pass to a callable (actual
> function T f(A,B,C), boost::function<T(A,B,C)>, fusion callables,
> etc...)?
>
> If so, would implicit conversions allowed and performed during a real
> call also happen using that facility?
>
> And if the "callable" is a constructor, is there a way to call a
> constructor? Thanks, --DD
>
> PS: Our app is plugin based and heavily uses factories in the base
> framework, but these are polymorphic and thus void* based in the base
> abstract factory class, and relied on default construction only. I've
> introduced non-default construction, and additional type safety, but
> it's still clunky and I'm exploring ways to provide a fully type safe
> plugeable factory mechanism, with static-based dynamic-registration on
> shared lib loading (when plugins are loaded), the ability to construct
> name-registered types with arbitrary args. A base type must support
> creation by more than one factory, taking different args (but a
> particular concrete type may choose to support only a subset of the
> factories its base type supports.) Any factory lib out there you know
> that fits the above description?

Fusion Functional (see http://tinyurl.com/oodztm) does that, but it
seems you know already. Boost.Tuple is a valid fusion sequence, so
you can use it for your fusion fused and unfused forms.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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