Changeset 1210:f02396423239 in lemon-0.x for src/work/deba/test.cpp
- Timestamp:
- 03/11/05 17:29:03 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1630
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/deba/test.cpp
r1036 r1210 3 3 using namespace std; 4 4 5 #include <lemon/utility.h> 5 6 7 using namespace std; 8 /* 6 9 struct _EmptyList { 7 10 void write() const {} … … 50 53 Writer().add(3).add("alpha").add(4.53).write(); 51 54 } 55 */ 56 57 class A { 58 public: 59 typedef int X; 60 }; 61 62 class C { 63 }; 64 65 template <typename A> 66 class TRUE { 67 public: 68 static const bool state = true; 69 }; 70 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 83 int main() { 84 printf("%s\n", B<A>::state(), true ? "true" : "false"); 85 printf("%s\n", B<C>::state(), true ? "true" : "false"); 86 return 0; 87 }
Note: See TracChangeset
for help on using the changeset viewer.