Changeset 1267:a93f94dbe3d3 in lemon-0.x for src/work
- Timestamp:
- 03/26/05 00:31:57 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1694
- Location:
- src/work/deba
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/deba/test.cpp
r1210 r1267 5 5 #include <lemon/utility.h> 6 6 7 using namespace std;7 using namespace lemon; 8 8 /* 9 9 struct _EmptyList { … … 58 58 public: 59 59 typedef int X; 60 typedef True XD; 60 61 }; 61 62 … … 63 64 }; 64 65 65 template <typename A> 66 class TRUE { 66 67 template <typename _A, bool _B = false> 68 class B { 69 public: 70 static const bool state = false; 71 }; 72 73 template <typename _A> 74 class B<_A, typename enable_if<typename _A::XD, void>::type> { 67 75 public: 68 76 static const bool state = true; 69 77 }; 70 78 71 template <typename _A>72 class B {73 public:74 typedef enable_if<A::X, int> state;75 };76 77 template <typename _A>78 class B<_A, void> {79 public:80 static const bool state = true;81 };82 79 83 80 int main() { 84 printf("%s\n", B<A>::state (), true? "true" : "false");85 printf("%s\n", B<C>::state (), true? "true" : "false");81 printf("%s\n", B<A>::state ? "true" : "false"); 82 printf("%s\n", B<C>::state ? "true" : "false"); 86 83 return 0; 87 84 }
Note: See TracChangeset
for help on using the changeset viewer.