S
Serengeti
Hello,
in my class I have a map that translates strings to pointers to some
member functions. The code goes like this:
class F {
typedef void (Function::*MathFuncPtr)();
std::map<std::string, MathFuncPtr> predefinedFunctions;
// lots of other stuff
void makeDictionary(){ predefinedFunctions["sin"]=&F::f_sin(); }
};
Code like this works all right in gcc, but causes a strange compile
time error[*] in VC (from MSVC++ 2005 express beta).
I'd be happy to know if it's my or VC's fault
TIA,
Slawek
[*]:
c:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(239) : error
C2065: '_Mycont' : undeclared identifier
c:\Program Files\Microsoft Visual Studio
8\VC\include\xtree(236) : while compiling class template member function
'const std:air<_Ty1,_Ty2>
&std::_Tree<_Traits>::const_iterator:perator *(void) const'
with
[
_Ty1=const std::string,
_Ty2=Function::MathFuncPtr ,
_Traits=std::_Tmap_traits<std::string,Function::MathFuncPtr
,std::less<std::string>,std::allocator<std:air<const
std::string,Function::MathFuncPtr >>,false>
]
c:\Program Files\Microsoft Visual Studio
8\VC\include\xtree(395) : see reference to class template instantiation
'std::_Tree<_Traits>::const_iterator' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,Function::MathFuncPtr
,std::less<std::string>,std::allocator<std:air<const
std::string,Function::MathFuncPtr >>,false>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\map(164)
: see reference to class template instantiation
'std::_Tree<_Traits>::iterator' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,Function::MathFuncPtr
,std::less<std::string>,std::allocator<std:air<const
std::string,Function::MathFuncPtr >>,false>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\map(163)
: while compiling class template member function 'void (Function::*
&std::map<_Kty,_Ty>:perator [](const
std::basic_string<_Elem,_Traits,_Ax> &))(void)'
with
[
_Kty=std::string,
_Ty=Function::MathFuncPtr,
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
d:\Documents and Settings\Serengeti\Moje dokumenty\My
Projects\Derivatives\Derivatives\function.h(36) : see reference to class
template instantiation 'std::map<_Kty,_Ty>' being compiled
with
[
_Kty=std::string,
_Ty=Function::MathFuncPtr
]
in my class I have a map that translates strings to pointers to some
member functions. The code goes like this:
class F {
typedef void (Function::*MathFuncPtr)();
std::map<std::string, MathFuncPtr> predefinedFunctions;
// lots of other stuff
void makeDictionary(){ predefinedFunctions["sin"]=&F::f_sin(); }
};
Code like this works all right in gcc, but causes a strange compile
time error[*] in VC (from MSVC++ 2005 express beta).
I'd be happy to know if it's my or VC's fault
TIA,
Slawek
[*]:
c:\Program Files\Microsoft Visual Studio 8\VC\include\xtree(239) : error
C2065: '_Mycont' : undeclared identifier
c:\Program Files\Microsoft Visual Studio
8\VC\include\xtree(236) : while compiling class template member function
'const std:air<_Ty1,_Ty2>
&std::_Tree<_Traits>::const_iterator:perator *(void) const'
with
[
_Ty1=const std::string,
_Ty2=Function::MathFuncPtr ,
_Traits=std::_Tmap_traits<std::string,Function::MathFuncPtr
,std::less<std::string>,std::allocator<std:air<const
std::string,Function::MathFuncPtr >>,false>
]
c:\Program Files\Microsoft Visual Studio
8\VC\include\xtree(395) : see reference to class template instantiation
'std::_Tree<_Traits>::const_iterator' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,Function::MathFuncPtr
,std::less<std::string>,std::allocator<std:air<const
std::string,Function::MathFuncPtr >>,false>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\map(164)
: see reference to class template instantiation
'std::_Tree<_Traits>::iterator' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,Function::MathFuncPtr
,std::less<std::string>,std::allocator<std:air<const
std::string,Function::MathFuncPtr >>,false>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\map(163)
: while compiling class template member function 'void (Function::*
&std::map<_Kty,_Ty>:perator [](const
std::basic_string<_Elem,_Traits,_Ax> &))(void)'
with
[
_Kty=std::string,
_Ty=Function::MathFuncPtr,
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
d:\Documents and Settings\Serengeti\Moje dokumenty\My
Projects\Derivatives\Derivatives\function.h(36) : see reference to class
template instantiation 'std::map<_Kty,_Ty>' being compiled
with
[
_Kty=std::string,
_Ty=Function::MathFuncPtr
]