Back to slide -- Keyboard shortcut: 'u'        next -- Keyboard shortcut: 'n'          decltype/dt1.cc - Trivial uses of decltype.Lecture 2 - slide 24 : 29
Program 1

// Trivial examples - not useful for practical purposes.

#include <iostream>
#include <vector>

int main(){
  double d1 = 5.5;
  std::vector<double> vd1{};  

  decltype(d1) d2 = 6.6;          // d2 is a double
  decltype(vd1) vd2{1.2, 3.4};    // vd2 is a vector

  int i = 7;
  decltype(d1+i) d3 = 7.7;        // d3 is a double

  // ...
}