// is_empty.cpp
#include <stdio.h>
struct S {
int Test() {}
static int i;
};
int main() {
__is_empty(S) == true ?
printf("true\n") : printf("false\n");
}
template<typename _Tp>
00359 struct __is_empty
00360 {
00361 private:
00362 template<typename>
00363 struct __first { };
00364 template<typename _Up>
00365 struct __second
00366 : public _Up { };
00367
00368 public:
00369 enum
00370 {
00371 __value = sizeof(__first<_Tp>) == sizeof(__second<_Tp>)
00372 };
00373 };
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |