Skip to content

Commit

Permalink
update something
Browse files Browse the repository at this point in the history
  • Loading branch information
liukai234 committed Apr 10, 2020
1 parent a5d008f commit 758e518
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion dbg工具/dbg使用示例.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2020-04-09 14:35:01
* @LastEditTime: 2020-04-10 11:59:10
* @LastEditTime: 2020-04-10 15:16:40
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /C++课程学习记录/test.cpp
Expand Down
10 changes: 7 additions & 3 deletions 容器和算法/algorithm.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2020-03-10 20:55:45
* @LastEditTime: 2020-04-01 11:07:00
* @LastEditTime: 2020-04-10 17:09:58
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /wanmen_container/algorithm.cpp
Expand All @@ -11,6 +11,7 @@
#include <list>
#include <string>
#include <vector>
// #include <dbg.h>

using namespace std;

Expand Down Expand Up @@ -41,6 +42,7 @@ bool has_c(const string &s, char c) {
return find(s.begin(), s.end(), c) != s.end();
}
*/

void trans() {
vector<string> quote{"This", "is", "a", "C++", "class"};
vector<string> res;
Expand All @@ -64,10 +66,12 @@ int main() {
trans();
// lambda 表达式
string str = "testing";
// cxx 14 lambda 类型推导
auto autopush = [](const auto &x) { return x * x; };
// 在lambad前的方括号中是外部变量访问方式说明符, = can be read &can be modified
auto qouit = [=, &str](const int &value) { cout << str; str = "modify"; return value * value; }; // CLASS STRUCT LAMBAD + ;
cout << qouit(10) << endl;
// dbg(str); // str 更新为"modify"

// cxx 14 lambda 类型推导
auto autopush = [](const auto &x) { return x * x; };
cout << autopush(10.10) << endl;
}

0 comments on commit 758e518

Please sign in to comment.