Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Last active January 25, 2016 09:32
Show Gist options
  • Save tetsuok/7ef5123628dbc9b6e056 to your computer and use it in GitHub Desktop.
Save tetsuok/7ef5123628dbc9b6e056 to your computer and use it in GitHub Desktop.
// g++ -std=c++11 auto.cc
#include <vector>
#include <string>
#include <iostream>
static std::vector<std::string> Foo() {
decltype(Foo()) v;
v.push_back("aii");
return v;
}
int main() {
auto v = Foo();
std::cout << v.back() << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment