Help in understanding the compiler error 
Author Message
 Help in understanding the compiler error

Hello,

    I am using Intel C++ compiler ( along with VC)

Can anybody please help me to understand the error the compiler is
generating ?
I am getting an internal error  -
The error is --

  "internal error: assertion failed at: "edgcpfe/ms_lower_name.c", line 1195
struct CManager:public CreationPolicy<Widget>"

The simple code is below
/////////////////////////////////////////

template<class T>
struct NewCreator
{
     T* create()
     {
          return new T;
     }

Quote:
};

struct Widget{};

template< template <class> class CreationPolicy>
struct CManager:public CreationPolicy<Widget> // Error here
{
     void something()
     {
          Widget* p = CreationPolicy<Widget>().create();
     }

Quote:
};

void main()
{
     CManager<NewCreator> myManager;
     myManager.something();

Quote:
}

Thanks in Advance
Anand


Sat, 04 Sep 2004 17:54:58 GMT  
 Help in understanding the compiler error
Does Intel compiler support template template parameters? VC6 does not.

You don't really need a template template parameter in your sample. You
can do it like this:

template<class CreationPolicy>
struct CManager:public CreationPolicy
{
     void something()
     {
         // I'd have made create() static in NewCreator
          Widget* p = CreationPolicy().create();
     }

Quote:
};

int main()
{
     CManager<NewCreator<Widget> > myManager;
     myManager.something();
    return 0;

Quote:
}

--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hello,

>     I am using Intel C++ compiler ( along with VC)

> Can anybody please help me to understand the error the compiler is
> generating ?
> I am getting an internal error  -
> The error is --

>   "internal error: assertion failed at: "edgcpfe/ms_lower_name.c",
line 1195
> struct CManager:public CreationPolicy<Widget>"

> The simple code is below
> /////////////////////////////////////////

> template<class T>
> struct NewCreator
> {
>      T* create()
>      {
>           return new T;
>      }
> };

> struct Widget{};

> template< template <class> class CreationPolicy>
> struct CManager:public CreationPolicy<Widget> // Error here
> {
>      void something()
>      {
>           Widget* p = CreationPolicy<Widget>().create();
>      }
> };

> void main()
> {
>      CManager<NewCreator> myManager;
>      myManager.something();
> }

> Thanks in Advance
> Anand



Sun, 05 Sep 2004 00:26:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help on my C code, dont understand how to fix my compiler errors (PLEASE HELP)

2. Newbie doesn't understand compiler error

3. Newbie doesn't understand compiler error

4. I can't understand this compiler error :(

5. understanding template-related compiler errors - any thoughts?

6. Please help : cannot understand error mesg.

7. help!! Errors I don't understand

8. Help me understand this compile error message.

9. Help with compiler error: fatal error LNK1169: one or more multiply defined symbols found

10. VC++6.0/SP3 Compiler Error: INTERNAL COMPILER ERROR

11. Vector of vectors - compiler doesn't understand?

12. Learning Linked Lists, Code Attached, My understanding of code attached, Please confirm understanding

 

 
Powered by phpBB® Forum Software