我针对VES2008编译了Greta,报告
error C2332: 'class' : missing tag name
error C3306: 'regex::detail::<unnamed-tag>': unnamed class template is not allowed
error C2143: syntax error : missing ';' before '__builtin_alignof'
error C2059: syntax error : '__builtin_alignof'
error C2143: syntax error : missing ';' before '{'
error C2447: '{' : missing function header (old-style formal list?)
template< typename T >
class alignof
{
struct helper
{
helper();
char m_c;
T m_t;
};
public:
enum { value = sizeof(helper)-sizeof(T) < sizeof(T) ? sizeof(helper)-sizeof(T) : sizeof(T) };
};
template< typename T >
class __alignof
{
struct helper
{
helper();
char m_c;
T m_t;
};
public:
enum { value = sizeof(helper)-sizeof(T) < sizeof(T) ? sizeof(helper)-sizeof(T) : sizeof(T) };
};
最佳答案
尽管alignof
在VS2008中似乎不是保留字,但它与 _alignof
极为相似,可能会使问题感到困惑。
尝试将您的类(class)名称更改为其他名称。
https://stackoverflow.com/questions/15892661/
相关文章:
android - 如何解决java.lang.NoClassDefFoundError
xcode - Intel C++编译器,无法在OS X上打开stdarg.h
compiler-errors - 错误: no newline at end of file [-
android - 如何解决Java Eclipse中的 “The hierarchy of the
perl - "error: variable length array of non-POD el
compiler-errors - 来自gtest-all.cc的Google测试编译错误
python - python err : Local variable referenced be