Unfortunately I still got a problem with my templated code from here:
C++ fancy template code problem
on line 49 in the file 'utility':
error C2440: 'Initializing': cannot convert from 'const int' to 'IntersectionData *' error C2439: 'std::pair<_Ty1,_Ty2>::second': member could not be initialized how could i figure out where the problem is? the only place i use a pair with 'IntersectionData*' is here:
#include "MRMaterialMatth.h" #include "IntersectionData.h" using namespace std; struct IShaderMatth { virtual ~IShaderMatth() {} vector<pair<MaterialMatth,IntersectionData*> > traceCols; }; and there are not any other compiler errors
how can I track down this?
//edit: utility is not my code. it must be from std.. the code of line 49 looks like this:
template<class _Other1, class _Other2> pair(const pair<_Other1, _Other2>& _Right) : first(_Right.first), second(_Right.second) { // construct from compatible pair } line 49 is the line of the comment
edit2: the only places where i change something about the content of tracecols look like this:
IntersectionData* iDataOut = NULL; if(newIData_out!=NULL) { iDataOut = new IntersectionData(*iData); } traceCols->push_back(make_pair(MaterialMatth(),iDataOut)); and
if(traceCols){ traceCols->push_back(make_pair(MaterialMatth(), NULL)); } and
if(traceCols) { (*traceCols)[traceCols->size()].second = new IntersectionData(*newIData); } is NULL the problem? it's a pointer, so i should be allowed to create a pair with NULL, no??