Peter Dimov wrote:
template struct constructor
{
template T * operator()(A1 const & a1)
{
return new T(a1);
}
};
FactoryA b = constructor();
Didn't even think to exploit the fact that function is
assignable to function :)
I only have one problem with this approach. The fact
From: "Anthony Liguori" <[EMAIL PROTECTED]>
[...]
> So I wrote up a class that provided virtual constructor functionality.
> It actually allows for types to be treated as objects including storing
> types in any STL container. This allows for really advanced factory
> algorithms and all sorts
Anthony Liguori <[EMAIL PROTECTED]> writes:
> David Abrahams wrote:
>
>>Now can we rename "factory" to "metaclass"? I just want to see smoke
>>come out of peoples' ears!
>>
> You know, this might be possible... If we can find a way to map
> members to function objects somewhat automatically,
Wh
David Abrahams wrote:
Now can we rename "factory" to "metaclass"? I just want to see smoke
come out of peoples' ears!
You know, this might be possible... If we can find a way to map members
to function objects somewhat automatically, this might be realistic.
After that, it's a simple sed sc
Anthony Liguori <[EMAIL PROTECTED]> writes:
> One thing has always bothered me about Loki's class factories
> (namely, one paragraph in Modern C++ Design). The fact that virtual
> constructions aren't considered possible in C++. Specifically, in
> chapter 8.2 where Andrei gives an example of cod
One thing has always bothered me about Loki's class factories (namely,
one paragraph in Modern C++ Design). The fact that virtual
constructions aren't considered possible in C++. Specifically, in
chapter 8.2 where Andrei gives an example of code that doesn't work in C++:
// Warning-this is N