Boost logo

Boost Users :

Subject: Re: [Boost-users] Expand tuple values as callable arguments
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-06-09 11:06:31


On Tue, Jun 9, 2009 at 9:00 AM, Dominique Devienne<ddevienne_at_[hidden]> 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?

I have done that exact thing a year or so back using Boost.Fusion.
Cannot check how I did it off-hand, but I think it was the invoke
thing, along with a few recursive templates to build what it needs...


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