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: Jaroslav Hajek
Subject: Re: Compilation error: auto_ptr and private class
Date: Fri, 12 Feb 2010 19:06:31 +0100

On Fri, Feb 12, 2010 at 3:56 PM, Michael Goffioul
<address@hidden> wrote:
> 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.
>

Yes, this seems to be a very good analogy.
But I sort of expected this; actually, I'd be surprised if MSVC++
messed up the access rights in all template instantiations with
private classes. That would significantly limit the usability of the
compiler.
I'd suggest you start with the Octave sources instead and keep
removing stuff up to the smallest failing skeleton. Of course, only if
you care to help Microsoft find the bug.

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

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