Last active
January 25, 2016 09:32
-
-
Save tetsuok/7ef5123628dbc9b6e056 to your computer and use it in GitHub Desktop.
Revisions
-
tetsuok revised this gist
Jan 25, 2016 . 1 changed file with 12 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,17 @@ // 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; } -
tetsuok revised this gist
Jan 25, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,6 @@ // g++ -std=c++14 auto.cc #include <stdio.h> class Node { public: Node(int a, int b) { printf("ctor\n"); } -
tetsuok revised this gist
Jan 25, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,6 @@ using namespace std; class Node { public: Node(int a, int b) { printf("ctor\n"); } static auto create(int a, int b) { return Node(a, b); } }; -
tetsuok created this gist
Jan 25, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // g++ -std=c++14 auto.cc #include <stdio.h> using namespace std; class Node { public: Node(int a, int b) { printf("ctor\n"); } Node(const Node&) { printf("copy ctor\n"); } static auto create(int a, int b) { return Node(a, b); } }; int main() { auto n = Node::create(1, 2); return 0; }