URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2008-03-22 Etienne FOLIO <folio(a)lrde.epita.fr>
Cleanup of the sandbox.
* chamfer_dt.cc: Remove.
* dmap.cc: Remove.
* dt_naive.cc: Remove.
* dt_naive.hh: Remove.
* exercices/heritage_conditionnel.cc: New.
* exercices/heritage_conditionnel.hh: New.
* exercices: New.
* heritage_conditionnel.cc: Remove.
* heritage_conditionnel.hh: Remove.
---
heritage_conditionnel.cc | 7 +++++++
heritage_conditionnel.hh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 53 insertions(+)
Index: trunk/milena/sandbox/folio/chamfer_dt.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/folio/heritage_conditionnel.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/folio/dmap.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/folio/dt_naive.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/folio/heritage_conditionnel.hh (deleted)
===================================================================
Index: trunk/milena/sandbox/folio/dt_naive.cc (deleted)
===================================================================
Index: trunk/milena/sandbox/folio/exercices/heritage_conditionnel.cc
===================================================================
--- trunk/milena/sandbox/folio/exercices/heritage_conditionnel.cc (revision 0)
+++ trunk/milena/sandbox/folio/exercices/heritage_conditionnel.cc (revision 1799)
@@ -0,0 +1,7 @@
+#include "heritage_conditionnel.hh"
+
+int main()
+{
+ new Bottom<1 == 1>();
+ new Bottom<1 == 0>();
+}
Index: trunk/milena/sandbox/folio/exercices/heritage_conditionnel.hh
===================================================================
--- trunk/milena/sandbox/folio/exercices/heritage_conditionnel.hh (revision 0)
+++ trunk/milena/sandbox/folio/exercices/heritage_conditionnel.hh (revision 1799)
@@ -0,0 +1,46 @@
+#ifndef HERITAGE_CONDITIONNEL_HH_
+# define HERITAGE_CONDITIONNEL_HH_
+
+# include <iostream>
+
+class TopLeft
+{
+protected:
+ TopLeft()
+ {
+ std::cout << "top left" << std::endl;
+ }
+};
+
+class TopRight
+{
+protected:
+ TopRight()
+ {
+ std::cout << "top right" << std::endl;
+ }
+};
+
+template<bool C, typename T, typename U>
+struct TraitCond
+{
+ typedef T type;
+};
+
+template<typename T, typename U>
+struct TraitCond<false, T, U>
+{
+ typedef U type;
+};
+
+template<bool B>
+class Bottom: public TraitCond<B, TopLeft, TopRight>::type
+{
+public:
+ Bottom()
+ : TraitCond<B, TopLeft, TopRight>::type()
+ {
+ }
+};
+
+#endif /* !HERITAGE_CONDITIONNEL_HH_ */