Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Intel compiler error

fmitha
Beginner
763 Views
08/26/2006
Hi,

The following bit of code compiles fine with gcc 3.3 or later, but has
problems with the Intel C++ compiler version 9.1, which produces the
following error message.

Is this a compiler bug, or is there something wrong with the code?

If the former, I'd be grateful for suggestions of a workaround, and if
the latter, please tell me what I'm doing wrong.

Note that the corresponding version with no templates compiles without
problems.

Thanks in advance. Faheem.
**************************************************************************

icpc -o foo.o -c -Wall -Werror -g -wd383,810,981,1418 cxxlib-icc
-DBOOST_RAND -I/usr/local/include/boost-1_33_1 foo.cpp

foo.cpp(12): error: no operator "=" matches these operands operand
types are: boost::function> =

choice = &rchoice;
^
*************************************************************

*************************************************************************
#include

template
int rchoice()
{
return 1;
}

template int foo(void)
{
boost::function choice;
choice = &rchoice;
return choice();
}

int main()
{
return foo<2>();
}

0 Kudos
5 Replies
mario__Intel_
Beginner
763 Views
Hi,

thanks for the information.Can you please specify the build date of the 9.1 compiler you use ? I will look into it asap ...
0 Kudos
mario__Intel_
Beginner
763 Views
Hi,

I could reproduce the problem even with the latest 9.1 version.

Please give me some more time to investigate what the root cause of the problem is.
0 Kudos
fmitha
Beginner
763 Views
Hi Mario,

Thanks.

Feel free to contact me directly at my email address for further information if necessary.

You probably don't need the version number, but if you do it is

icc --version
icc (ICC) 9.1 20060707

Faheem.

0 Kudos
mario__Intel_
Beginner
763 Views

Hi Faheem,

where do I find your email adress ?

0 Kudos
fmitha
Beginner
763 Views
Hi Mario,

I thought you'd have access to it since you work for Intel and I had to put it in to register.

Anyway, here it is, faheem@email.unc.edu.

Faheem Mitha.

0 Kudos
Reply