Boost logo

Boost Users :

From: voodoo4 (voodoo4_at_[hidden])
Date: 2004-02-26 12:27:07


*Colin Rafferty wrote:*
> Just like initializing anything else in a different function.
>
> extern shared_array<Slave> createSharedArray();
>
> Master::Master(int val)
> : sl(::createSharedArray())
> {
> }

Well it is not what i meant but it doesn't really matter cause i solved my
problem.
I just had to do a simple cast...Duh!
And for anyone interested:

//A macro to to shorten the shared_array template code.Not really strong
typed...
#define SM_A(x) boost::shared_array<x>

class Slave
{
    Slave(){ };
    ~Slave(){ };
};

class Master
{
public:
    Master(){ };
    ~Master(){ };
    void SomeFunction(int val){ sl = SM_A(Slave)(new sl[val];};

    SM_A(Slave) sl;
};

As i suspected.I'm an idiot who's bothering other people with his ridiculous
problems...
Thanks for your replies.


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