in_place_factory0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

in_place_factory0

Vaclav Vesely
Hi,

is there any reason for missing in_place_factory without arguments? I would
like to write

    optional<my_class> mc(in_place());

I've wrote the code for this. But I can't modify the macro hell in
"in_place_factory.hpp".

Regards,
Vaclav


class in_place_factory0: public in_place_factory_base
{
public:
    in_place_factory0()
    {}

    template<class T>
    void apply(void* address) const
    {
        new(address) T();
    }
};

in_place_factory0 in_place()
{
    return in_place_factory0();
}



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost