support bazel complie this project and format code.

This commit is contained in:
zhangxing
2023-03-30 00:15:11 +08:00
committed by light-city
parent 1f86192576
commit 7529ae3a55
636 changed files with 10025 additions and 9387 deletions

View File

@@ -11,7 +11,10 @@ public:
void do_length_work() {};
};
void process_big_object(std::unique_ptr<X>);
void process_big_object(std::unique_ptr<X>)
{
// TODO
}
int main() {
X my_x;

View File

@@ -6,6 +6,7 @@
#include <unistd.h>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

View File

@@ -6,6 +6,7 @@
#include <thread>
#include <vector>
#include <numeric>
#include <functional>
using namespace std;

View File

@@ -0,0 +1,30 @@
# please run `bazel run //concurrency/concurrency_v1/chapter2:2.4_runtime`
# please run `bazel run //concurrency/concurrency_v1/chapter2:2.1_basic`
# please run `bazel run //concurrency/concurrency_v1/chapter2:2.3_ownership`
# please run `bazel run //concurrency/concurrency_v1/chapter2:2_5_id`
# please run `bazel run //concurrency/concurrency_v1/chapter2:2.2_transfer`
load("@rules_cc//cc:defs.bzl", "cc_binary")
cc_binary(
name = "2.4_runtime",
srcs = ["2.4_runtime.cpp"],
)
cc_binary(
name = "2.1_basic",
srcs = ["2.1_basic.cpp"],
)
cc_binary(
name = "2.3_ownership",
srcs = ["2.3_ownership.cpp"],
)
cc_binary(
name = "2_5_id",
srcs = ["2_5_id.cpp"],
copts = ["-std=c++11"]
)
cc_binary(
name = "2.2_transfer",
srcs = ["2.2_transfer.cpp"],
copts = ["-std=c++11"]
)