|
|
I'm porting an app from Windows to Linux. The app compiles and runs
under Windows using VC++ 7.0.
I have a template consisting of a nested class type that is public:
template <class KEY, class VALUE, class KEY_MGR, class VALUE_MGR>
class skip_list_type
{
public:
inline int get_count() { return count; }
class node_type {
Which, compiles.
I try to use this class in another template:
template <class MYCHAR> class string_index_map_type :
public skip_list_type< MYCHAR *, int *,
char_manip<MYCHAR>,
fdt_copier<int *> >
But....
access to protected members of skip_list_type by string_index_map_type
flag with an error:
parserado/src/string_map.h: In constructor
'parse::string_index_map_type<MYCHAR>::string_index_map_type()':
parserado/src/string_map.h:49: error: 'allowDuplicates' was not
declared in this scope
which, it most certainly was.
And, inside of a method, when I try to refer to node_type, a nested
type of skip_list_type, via
MYCHAR *set( MYCHAR *_key, int _index )
{
skip_list_type< MYCHAR *, int *, char_manip< MYCHAR >,
fdt_copier<int *> >::node_type *node;
I get,
parserado/src/string_map.h: In member function 'MYCHAR*
parse::string_index_map_type<MYCHAR>::set(MYCHAR*, int)':
parserado/src/string_map.h:68: error: 'node' was not declared in
this scope
I've "proved" that skip_list_type is visible to the unit being
compiled. Removing it produces different errors, and, if I don't
inherit from the skip list, but instead contain it, then, the message
regarding allowDuplicates goes away when I properly refer to it by its
name contained name.
I'm using GCC 4.02 as shipped with SUSE Linux 10. This smells like a
compiler bug...or am I just doing something wrong. If so, where does
one go to read the recommended procedure for updating their GCC
installation? And, more importantly, would the latest GCC fix this
particular bug?
|
|