CPP/Typeof

From ProgrammingExamples
< CPP
Jump to: navigation, search

Typeof.cpp

#include <iostream>
#include <vector>
 
int main(int, char*[])
{
 
  int a = 2;
  std::cout << a << std::endl;
 
  typeof(a) b = 3;
  std::cout << b << std::endl;
 
  std::vector<typeof(a)> vec;
  vec.push_back(1);
  std::cout << vec[0] << std::endl;
  return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 2.6)
 
PROJECT(Typeof)
 
ADD_EXECUTABLE(Typeof Typeof.cpp )