c++/9783: Can't forward reference class in argument to templated method.
mleone@pixar.com
mleone@pixar.com
Thu Feb 20 23:26:00 GMT 2003
>Number: 9783
>Category: c++
>Synopsis: Can't forward reference class in argument to templated method.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Feb 20 23:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Mark Leone
>Release: g++ 3.2
>Organization:
>Environment:
RedHat 7.2, i686 multiprocessor
>Description:
The following fails to compile. Workaround is to declare forward reference to class outside the template.
template<class Info>
class Table {
public:
bool Lookup(int name, class Detail* detail, Info* info) const;
void Insert(int name, class Detail* detail, Info info);
};
class Detail {
public:
int stuff;
};
template<class Info>
bool Table<Info>::Lookup(int name, Detail* detail, Info* info) const {
return true;
}
template<class Info>
void Table<Info>::Insert(int name, Detail* detail, Info info) {
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list