A
Alf P. Steinbach
When I do this:
typedef function< void( Type const& ) > DestroyFunc;
then Visual C++ 10.0 is happy.
But when I do this:
typedef function< void(*)( Type const& ) > DestroyFunc;
then it spews out a long sequence of silly error messages, like
<sillyErrorMessages>
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(94): error C2027: use of undefined type
'std::tr1::_Get_function_impl<_Tx>'
1> with
1> [
1> _Tx=void (__cdecl *)(const int &)
1> ]
1> d:\dev\utility\clear_rounded_corners\cppx\owned.h(35) : see
reference to class template instantiation 'std::tr1::function<_Fty>'
being compiled
1> with
1> [
1> _Fty=void (__cdecl *)(const int &)
1> ]
1> d:\dev\utility\clear_rounded_corners\main.cpp(283) : see
reference to class template instantiation 'cppx::Owned<Type>' being compiled
1> with
1> [
1> Type=int
1> ]
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(95): error C2504: '_Type' : base class undefined
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C2027: use of undefined type
'std::tr1::_Get_function_impl<_Tx>'
1> with
1> [
1> _Tx=void (__cdecl *)(const int &)
1> ]
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C2146: syntax error : missing ';'
before identifier '_Mybase'
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
</sillyErrorMessages>
What? Isn't that function type decaying to pointer to function type? And
if it isn't, shouldn't std::function be able to tackle pointer to
function type?
Cheers, & just wondering,
- Alf
typedef function< void( Type const& ) > DestroyFunc;
then Visual C++ 10.0 is happy.
But when I do this:
typedef function< void(*)( Type const& ) > DestroyFunc;
then it spews out a long sequence of silly error messages, like
<sillyErrorMessages>
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(94): error C2027: use of undefined type
'std::tr1::_Get_function_impl<_Tx>'
1> with
1> [
1> _Tx=void (__cdecl *)(const int &)
1> ]
1> d:\dev\utility\clear_rounded_corners\cppx\owned.h(35) : see
reference to class template instantiation 'std::tr1::function<_Fty>'
being compiled
1> with
1> [
1> _Fty=void (__cdecl *)(const int &)
1> ]
1> d:\dev\utility\clear_rounded_corners\main.cpp(283) : see
reference to class template instantiation 'cppx::Owned<Type>' being compiled
1> with
1> [
1> Type=int
1> ]
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(95): error C2504: '_Type' : base class undefined
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C2027: use of undefined type
'std::tr1::_Get_function_impl<_Tx>'
1> with
1> [
1> _Tx=void (__cdecl *)(const int &)
1> ]
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C2146: syntax error : missing ';'
before identifier '_Mybase'
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\functional(98): error C4430: missing type specifier -
int assumed. Note: C++ does not support default-int
</sillyErrorMessages>
What? Isn't that function type decaying to pointer to function type? And
if it isn't, shouldn't std::function be able to tackle pointer to
function type?
Cheers, & just wondering,
- Alf