Answers for "decltype in c++"

C++
2

auto in cpp

#include<iostream>
#incllude<vector>
using namespace std;

int main() {
   vector<int> vec(10);       // Auto deduce type to be iterator of a vector of ints.
   for(auto it = vec.begin(); it != vec.end(); vec ++)
   {
      cin >> *it;
   }
   return 0;
}
Posted by: Guest on December-09-2020
0

decltype in c++

decltype is useful when declaring types that are difficult or impossible to declare using standard notation, like lambda-related types or types that depend on template parameters.
Posted by: Guest on November-12-2021

Browse Popular Code Answers by Language