__typeof -identifier not found
For some reason I keep getting
error C3861: '__typeof': identifier not found
when I compile my program!
I开发者_运维知识库'm including the following libraries:
<iostream>
<stdlib>
<stdio>
Any ideas?
thanks
Edit:
More example
User.h
class User{}
main.cpp
void f(User* p)
{
.
.
.
__typeof(p) ...
.
.
.
.
}
http://msdn.microsoft.com/en-us/library/x2xw8750%28VS.71%29.aspx
__typeof only exists for /clr:oldSyntax. Are you trying to use Managed extensions to C++ or are you expecting __typeof to work like C++0x's decltype? If so, if you are using VS 2010 you can use decltype.
Perhaps the function __typeof() doesn't exist? Do you mean typeof()?
How to typeof in C++
Try adding:
#using <mscorlib.dll>
using namespace System;
to the top of your C file and compile with /clr /LD.
Link
加载中,请稍侯......
精彩评论