should work, but don't forget to derive 'derived' from base:
class derived : base
{...}
Is there any C++ design pattern could achieve it? Thanks
Since you're passing the size into the derived constructor, why don't you just pass it through to the base constructor?
class base
{
public:
base(size_t array_size):size(array_size)
{
p_array.reset(new unsigned char[size]);
}private:class derived
size_t size;
boost::shared_array<unsigned char> p_array;
};
{
public:
derived(size_t array_size):base(array_size)
{
}
};
Will that work for you?
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users