[cpp]#include
union empty_union { };
int main()
{
assert(__is_empty(empty_union));
return 0;
}[/cpp]
However, according to the latest ISO C++ 0x draft, std::is_empty should not recognize empty unions. GCC's __is_empty does not recognize empty unions as well.
I hope you compiled with g++ 4.3.x and later, as probably __is_empty does not work (and is not recognized and gives error) with 4.2.x or lower, could be due to c++0x features and functions.
I reproduced your problem, the icc & gcc give different result with __is_empty .
I hope you compiled with g++ 4.3.x and later, as probably __is_empty does not work (and is not recognized and gives error) with 4.2.x or lower, could be due to c++0x features and functions.
I reproduced your problem, the icc & gcc give different result with __is_empty .