template-class-id redefined problem

  • Thread starter saksenaabhishek
  • Start date
S

saksenaabhishek

Hi Guys,
I have some problem in compiling the following code, specially with
MSVC++.Net2003 (Code works fine with GCC compiler)
=========================================
template< typename PROTOCOL>
class port:public smart::smart_port<
typename PROTOCOL::transport::eek:utput::type,
typename PROTOCOL::transport::input::type >
{
private:
/* Handy typedefs*/
typedef port<PROTOCOL> my_type;
typedef typename PROTOCOL::transport::input::type input_interface;
typedef typename PROTOCOL::transport::eek:utput::type
output_interface;

typedef smart::smart_port<
output_interface,
input_interface
base_port_type;

port(my_type& port_,unsigned int id=0):
base_port_type(sc_gen_unique_name ("port"),
port_,id),
view(this)
{
}
port(base_port_type& port,unsigned int id=0):
base_port_type(sc_gen_unique_name ("port"),port,id),
view(this)
{
}
};
========================================
MS compiler complians about error C2942: 'pse::port<PROTOCOL>' :
template-class-id redefined as a formal argument of a function

This error appears at the second constructor i.e. line containing code
"port(base_port_type& port,unsigned int id=0):"

Do you have any clue about the problem and how it can be sloved.

AS
 
V

Victor Bazarov

I have some problem in compiling the following code, specially with
MSVC++.Net2003 (Code works fine with GCC compiler)
=========================================
template< typename PROTOCOL>
class port:public smart::smart_port<
typename PROTOCOL::transport::eek:utput::type,
typename PROTOCOL::transport::input::type >
{
private:
/* Handy typedefs*/
typedef port<PROTOCOL> my_type;

Have you tried simply

typedef port my_type;

?
typedef typename PROTOCOL::transport::input::type input_interface;
typedef typename PROTOCOL::transport::eek:utput::type
output_interface;

typedef smart::smart_port<
output_interface,
input_interface

port(my_type& port_,unsigned int id=0):
base_port_type(sc_gen_unique_name ("port"),
port_,id),
view(this)
{
}
port(base_port_type& port,unsigned int id=0):
base_port_type(sc_gen_unique_name ("port"),port,id),
view(this)
{
}
};
========================================
MS compiler complians about error C2942: 'pse::port<PROTOCOL>' :
template-class-id redefined as a formal argument of a function

I don't see "pse" here anywhere. Are there any macros you didn't tell
us about?
This error appears at the second constructor i.e. line containing code
"port(base_port_type& port,unsigned int id=0):"

Do you have any clue about the problem and how it can be sloved.

Could you reproduce the same error message in a simpler setting, and
post the complete code so that we could try compiling it?

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top