c++ - VS 2005 to VS 2012: do I need a cast now? -


ok, have been searching solution error day, kind of last hope.

i have ported solution vs 2005 vs 2012 may make difference if settings or compiler have changed.

i have typedef used in struct in template:

typedef bool (__cdecl *tbreakpointer)(const double&, const double&);  template <typename _t> struct s_optparameter {   tbreakpointer pabortpointer; }; 

these lines give me error (line in switch statement '=' in it):

optpara.nid = static_cast<unsigned int>(m_parameterlist->indexof(item)); optpara.nscale = item->scale;  switch (item->abort) {   case geneticaborttype::greater:     optpara.pabortpointer = checkgreater;     break; } 

checkgreater defined this:

bool checkgreater(const double& nact, const double& nbreak) {   return (nact > nbreak); } 

now error get:

error c2440: '=' : cannot convert 'bool (__stdcall *)(const double &,const double &)' 'tbreakpointer' conversion requires reinterpret_cast, c-style cast or function-style cast 

all usual answers don't seem fit problem code has been fine in vs 2005 , not in vs 2012 - or hints appreciated.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -