Boost logo

Boost Users :

Subject: Re: [Boost-users] [Parameter] abstract base class
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-09-15 15:28:32


AMDG

Noah Roberts wrote:
> I have a design in which I must inherit from a class with a whole lot of
> construction parameters. I need to have a pure virtual function in the
> class that inherits from this thing and is then provided by subclasses.
> Since the classes in question must all accept this huge list of
> construction parameters I would like to use named parameters.
> Unfortunately there's a problem caused by the attempt to create a
> function pointer declaration that takes the base class by value.
>
> I don't really understand why this is going on. Instead of just calling
> the base's constructor directly, the BOOST_PARAMETER_CONSTRUCTOR macro
> creates a type resolution instantiation with this:
>
> boost::parameter::aux::unaryfunptr_arg_type< void(*)(B) >::type
>
> 'B' being the base class.
>
> This explodes if B is an abstract class. Both g++ 3.4.5 (mingw) and
> VS2010 hate this line.
>
> Before I go about attempting to devise a workaround, what is the purpose
> of this strange bit of code? Why not just use 'B' directly?? The type
> resolution metafunction simply returns the 'B' place argument as its
> type anyway...
>

This bit of code exists to strip the parentheses off (B).

In Christ,
Steven Watanabe


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