COIN-OR::LEMON - Graph Library

Changeset 1267:a93f94dbe3d3 in lemon-0.x for src/work/deba


Ignore:
Timestamp:
03/26/05 00:31:57 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1694
Message:

First version of iterable maps.

Location:
src/work/deba
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/deba/test.cpp

    r1210 r1267  
    55#include <lemon/utility.h>
    66
    7 using namespace std;
     7using namespace lemon;
    88/*
    99struct _EmptyList {
     
    5858public:
    5959  typedef int X;
     60  typedef True XD;
    6061};
    6162
     
    6364};
    6465
    65 template <typename A>
    66 class TRUE {
     66
     67template <typename _A, bool _B = false>
     68class B {
     69public:
     70  static const bool state = false;
     71};
     72
     73template <typename _A>
     74class B<_A, typename enable_if<typename _A::XD, void>::type> {
    6775public:
    6876  static const bool state = true;
    6977};
    7078
    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 };
    8279
    8380int 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");
    8683  return 0;
    8784}
Note: See TracChangeset for help on using the changeset viewer.