cpp11/auto.cc

26 lines
407 B
C++
Raw Normal View History

2012-05-05 12:45:44 -07:00
#include <vector>
#include <string>
#include <iostream>
const std::vector<std::string> mcquays = {
"stephen",
"michael",
"bryan",
"derek",
};
int func() {
return 42;
}
int main() {
auto i = 5;
auto j = func();
auto s = std::string{"hello world"};
for(auto it = mcquays.begin();
it != mcquays.end(); it++) {
std::cout << *it << std::endl;
}
}