Ignore:
Timestamp:
Jun 27, 2010, 2:24:42 AM (12 years ago)
Author:
Peter
Message:

adding a class Dereferencer, a functor that returns *argument. refs #632

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/utility_test.cc

    r2274 r2285  
    6464void test_ptr_compare(test::Suite& suite);
    6565void test_compose_functors(test::Suite& suite);
     66void test_dereferencer(test::Suite& suite);
    6667
    6768int main(int argc, char* argv[])
     
    225226}
    226227
     228
     229void test_dereferencer(test::Suite& suite)
     230{
     231  using utility::Dereferencer;
     232  Dereferencer<double*> deref;
     233  double x = 0;
     234  double* px = &x;
     235  deref(px) = 1.662;
     236  if (!suite.add(x==1.662)) {
     237    suite.out() << "test_dereferencer failed: x: " << x << "\n";
     238  }
     239}
    227240
    228241
     
    495508
    496509}
     510
Note: See TracChangeset for help on using the changeset viewer.