octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compilation error: auto_ptr and private class


From: Michael Goffioul
Subject: Re: Compilation error: auto_ptr and private class
Date: Fri, 12 Feb 2010 14:56:27 +0000

On Fri, Feb 12, 2010 at 2:24 PM, John Swensen <address@hidden> wrote:
> Maybe this is just shooting in the dark, but I think the example you gave in 
> the forum thread is a little different than what is actually going on.  Try 
> this instead (I am installing the MSVC++ student edition right now so I can 
> test this with you).
>
> class A
> {
> private:
>  class private_one
>  {
>  public:
>    ~private_one(void) {}
>  };
>
>  class private_two : public private_one
>  {
>  public:
>    ~private_two(void){}
>  };
>
> public:
>  void fun(void);
> };
>
> void A:fun(void)
> {
>  auto_ptr<private_two> two (new private_two ());
> }
>
>
> The problem may be that one private class is the base class for another 
> private class?  Maybe they need to be "friend" declaration between the 
> private base class and private derived class (and maybe declared as 
> "protected")?  Like I said, I am just shooting in the dark right now, since I 
> don't have a working MSVC++ yet.
>
> John Swensen

I can't test at the moment, no access to Windows at work. However, I
came up with
the following piece of code that hopefully mimic what's happening in
idx-vector.cc. I'll
try it at home asap.

Michael.

Attachment: test.cc
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]