main.cpp 1014 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <iostream>
  2. #include <vector>
  3. #include <utility>
  4. #include "value.hpp"
  5. using namespace std;
  6. void print_pair(DerivedPair<double, double> p){
  7. pair<double, double> pr = p.get_value();
  8. cout << "(" << pr.first << ", " << pr.second << ")\n";
  9. }
  10. int main(int argc, const char* argv[]){
  11. /* Value<int, int> v; */
  12. double x = 12;
  13. double y = 12;
  14. ObservedValue<double> x_val(&x);
  15. ObservedValue<double> y_val(&y);
  16. DerivedPair<double, double> dp(&x_val, &y_val);
  17. print_pair(dp);
  18. x = 2;
  19. y = 2;
  20. print_pair(dp);
  21. ContainerVector<double> cont(&x_val);
  22. x = 12;
  23. cont.fill();
  24. x = 2;
  25. cont.fill();
  26. auto *container = cont.get_container();
  27. for( auto v: *container )
  28. cout << v << ", ";
  29. cout << endl;
  30. /* ValA val; */
  31. /* val.reset(); */
  32. /* Address x = val.get_value(); */
  33. /* cout << "Hello World " << x.street_address << "\n"; */
  34. /* x = val.get_value(); */
  35. /* cout << "Hello World " << x.street_address << "\n"; */
  36. }