[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compilation error: auto_ptr and private class
From: |
John Swensen |
Subject: |
Re: Compilation error: auto_ptr and private class |
Date: |
Fri, 12 Feb 2010 09:24:57 -0500 |
On Feb 12, 2010, at 8:13 AM, Michael Goffioul wrote:
> On Fri, Feb 12, 2010 at 8:52 AM, Jaroslav Hajek <address@hidden> wrote:
>> Another bug in MSVC++, IMO. See C++ standard, sec. 14.3, paragraph 3:
>>
>> The name of a template-argument shall be accessible at the point
>> where it is used as a template-argument.
>
> I started a thread on MSVC forum, but it seems the problem is more complex
> than simply MSVC not being unable to deal with private classes. See the thread
> http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/6cd70115-5b7b-47c8-a0cd-5a6f2d755784
>
> If anybody would have a stripped down example that *might* reproduce the
> problem, I'd appreciate.
>
> Michael.
>
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
- Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Jaroslav Hajek, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Jaroslav Hajek, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Jaroslav Hajek, 2010/02/12
- Re: Compilation error: auto_ptr and private class, Michael Goffioul, 2010/02/13
Re: Compilation error: auto_ptr and private class, Jordi GutiƩrrez Hermoso, 2010/02/12