473,372 Members | 859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

[BUG]? "cannot access inaccessible typedef"

I was wondering if anyone could give me some help with the following.
Consider the code snippet:

struct qqq{typedef qqq* pointer;};

template<class al> struct foo : public al
{
template <class T> struct rebind
{
typedef foo<qqq> other;
};
};

int main()
{
typedef foo<qqq >::rebind<qqq>::other alloc_typ;
typedef alloc_typ::rebind<qqq>::other::pointer pppp;
return 0;
}

Is there any reason that this code should not compile? MS VC .NET 2003
gives error message:

c:\Documents and Settings\tblamb\My Documents\Visual Studio
Projects\test0\test0\test0.cpp(20) : error C2248:
'foo<al>::rebind<T>::other' : cannot access inaccessible typedef
declared in class 'foo<al>'
with
[
al=qqq,
T=qqq
]
and
[
al=qqq
]
.... etc.

Unfortunately, I cannot see why the typedef ought to be inaccessible.
(Indeed, the error message itself is a little strange, since normally
the compiler gives messages like "cannot access private typedef" or
"cannot access protected typedef", which explain why the symbol is
inaccessible, rather than just "cannot access inaccessible typedef".)
The www.comeaucomputing.com compiler accepted the code. I have not
tested it with g++.

Thanks for any help!

Thomas Barnet-Lamb
Programmer, Lionhead Studios Ltd.
www.lionhead.com
Nov 16 '05 #1
1 3095
Thomas,
Unfortunately, I cannot see why the typedef ought to be inaccessible.
I cannot either -- it definitely looks like a bug in the compiler. I'll
enter it to our database.
(Indeed, the error message itself is a little strange, since normally
the compiler gives messages like "cannot access private typedef" or
"cannot access protected typedef", which explain why the symbol is
inaccessible, rather than just "cannot access inaccessible typedef".)


I agree that "cannot access inacessible" sounds silly. We'll fix it.

Thanks for your feedback.

Artur Laksberg,
Visual C++ Compiler Development Team
This posting is provided AS IS with no warranties, and confers no rights.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Fao | last post by:
Hi, I am in my first year of C++ in college and my professor wants me to Write a Program with multiple functions,to input two sets of user-defined data types: One type named 'Sign' declared by...
6
by: hercules | last post by:
Hi: In some code , I used typedef unsigned char BOOL; /*boolean */ But in other code , I must use typedef unsigned int BOOL; /* boolean */ How to remove the previous typedef ? ...
4
by: Sacha | last post by:
I'm aware, that up to date, "typedef templates" are not defined within the C++ standard. The seemingly common workaround is this: template <class T> struct MyTypeDef { /* ultimately I need...
10
by: asnowfall | last post by:
I get following compilation error C3149: 'System::String' : cannot use this type here without a top-level '^'. Could someone explain why I get this error? here is the code... ImageFileData.h...
134
by: jacob navia | last post by:
Hi Suppose you have somewhere #define BOOL int and somewhere else typedef BOOL int;
2
by: Rajat Tandon | last post by:
Hi, I have a grid which is continuously updating by the data from a external event. When I close the form on which the grid is placed, then it gives the error message ... "Can not access a...
8
by: Mohammad Omer Nasir | last post by:
Hi, i made a structure in header file "commonstructs.h" is: typedef struct A { int i; A( ) {
8
by: cman | last post by:
What does this kind of typedef accomplish? typedef struct { unsigned long pte_low; } pte_t; typedef struct { unsigned long pgd; } pgd_t; typedef struct { unsigned long pgprot; } pgprot_t I am...
4
by: msukumarbabu | last post by:
Hi all, What will be difference between "typedef enum" and "enum". or difference between “typedef structure" and "structure" I am going through some code. in that some place they are using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.