std::auto_ptr issue

std::auto_ptr issue


I'm using the following snippet of code:
typedef std::auto_ptr PRC; // pointer to results cache when I am defining a class.

later I try to do the following:

n = NEU::PRC(new NEU::results_cache);
e = NEU::PRC(new NEU::results_cache);

where n and e are defined as:
// the node cache

// the element cache

on compilation I get the following error message
FNO2OP2.h(81): error: no operator "=" matches these operands
operand types are: NEU::PRC = NEU::PRC
n = NEU::PRC(new NEU::results_cache);

My question: I thought std C++ supports the assignment operator between auto_ptr's ??
does this not work with the intel compiler ?

now having said that, the following works.
//n = NEU::PRC(new NEU::results_cache);
NEU::PRC temp1(new NEU::results_cache);
n = temp1;


8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I am also getting a similar error. Has anyone from Intel seen this post?

Please check whether following code works with your configuration/compiler -


using namespace std;

int main()
typedef std::auto_ptr PRC;

PRC n;
// PRC e;

n = PRC(new string);
// e = PRC(new string);

return 0;

Which version of Intel compiler are you using?


I tried to compile that piece of code with icc v7.1 and received the following error:

icc test.cpp
test.cpp(13): error: no operator "=" matches these operands
operand types are: PRC = PRC
n = PRC(new string);

I did however get this test.cpp code to successfully compile with gcc 3.3.

This test works for me with latest Intel compiler -
Version 7.1 Build 20030507Z (l_cc_pc_7.1.015-INT).

[jain@jaffa jain]$ icpc test.cpp
[jain@jaffa jain]$ ./a.out

"icpc -V or icid" will tell you which build of Intel
compiler you are using.


The version of icc you mention does not appear to be available for download. What did you have to do to get a hold of it?

I think you will need to register yourself at Intel's premier site - to get
latest compiler builds.

Leave a Comment

Please sign in to add a comment. Not a member? Join today