text
stringlengths
24
1.04M
metadata
stringlengths
233
497
### File: gen-python/opencensus/proto/trace/v1/__init__.py # Copyright 2019, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/opencensus-proto", "path": "gen-python/opencensus/proto/trace/v1/__init__.py", "license": "apache-2.0", "size": 584}
### File: gen-python/setup.py # Copyright 2019, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/opencensus-proto", "path": "gen-python/setup.py", "license": "apache-2.0", "size": 1839}
### File: gen-python/version.py # Copyright 2019, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/opencensus-proto", "path": "gen-python/version.py", "license": "apache-2.0", "size": 644}
### File: src/BUILD.bazel # Copyright 2017, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/BUILD.bazel", "license": "apache-2.0", "size": 638}
### File: src/WORKSPACE # Copyright 2016-17, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/WORKSPACE", "license": "apache-2.0", "size": 3490}
### File: src/install-protoc.sh #!/usr/bin/env bash set -e readonly PROTOC_VER="3.12.3" readonly PROTOC_ARCHIVE="protoc-${PROTOC_VER}-linux-$( uname -m ).zip" readonly PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/${PROTOC_ARCHIVE}" readonly PROTOC_GEN_GO_VER="1.25.0" reado...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/opencensus-proto", "path": "src/install-protoc.sh", "license": "apache-2.0", "size": 3991}
### File: src/mkgogen.sh #!/usr/bin/env bash # Run this if opencensus-proto is checked in the GOPATH. # go get -d github.com/census-instrumentation/opencensus-proto # to check in the repo to the GOAPTH. # # This also requires the grpc-gateway plugin. # See: https://github.com/grpc-ecosystem/grpc-gateway#installation #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/opencensus-proto", "path": "src/mkgogen.sh", "license": "apache-2.0", "size": 2252}
### File: src/mkpygen.sh #!/usr/bin/env bash # # Prerequisite: # - install gRPC tools # python -m pip install grpcio-tools # # Learn more about gRPC Python tools at https://grpc.io/docs/quickstart/python.html. # # To generate: # # git clone git@github.com:census-instrumentation/opencensus-proto.git # # cd opencensus...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/opencensus-proto", "path": "src/mkpygen.sh", "license": "apache-2.0", "size": 1279}
### File: src/mkrubygen.sh #!/usr/bin/env bash # # Prerequisite: # - install "grpc" gem # gem install grpc # # To generate: # # git clone git@github.com:census-instrumentation/opencensus-proto.git # # cd opencensus-proto/src # ./mkrubygen.sh OUTDIR="../gen-ruby" mkdir -p $OUTDIR grpc_tools_ruby_protoc -I ./ --rub...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/opencensus-proto", "path": "src/mkrubygen.sh", "license": "apache-2.0", "size": 1219}
### File: src/opencensus/proto/agent/common/v1/BUILD.bazel # Copyright 2018, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/agent/common/v1/BUILD.bazel", "license": "apache-2.0", "size": 1251}
### File: src/opencensus/proto/agent/metrics/v1/BUILD.bazel # Copyright 2018, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/agent/metrics/v1/BUILD.bazel", "license": "apache-2.0", "size": 1768}
### File: src/opencensus/proto/agent/trace/v1/BUILD.bazel # Copyright 2018, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/agent/trace/v1/BUILD.bazel", "license": "apache-2.0", "size": 1809}
### File: src/opencensus/proto/metrics/v1/BUILD.bazel # Copyright 2018, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/metrics/v1/BUILD.bazel", "license": "apache-2.0", "size": 1580}
### File: src/opencensus/proto/resource/v1/BUILD.bazel # Copyright 2018, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/resource/v1/BUILD.bazel", "license": "apache-2.0", "size": 1330}
### File: src/opencensus/proto/stats/v1/BUILD.bazel # Copyright 2017, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/stats/v1/BUILD.bazel", "license": "apache-2.0", "size": 1370}
### File: src/opencensus/proto/trace/v1/BUILD.bazel # Copyright 2017, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/opencensus-proto", "path": "src/opencensus/proto/trace/v1/BUILD.bazel", "license": "apache-2.0", "size": 2875}
### File: docs/Makefile # Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/osrf_pycommon", "path": "docs/Makefile", "license": "apache-2.0", "size": 6790}
### File: docs/make.bat @ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_siz...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Batchfile", "repo_name": "minhanghuang/osrf_pycommon", "path": "docs/make.bat", "license": "apache-2.0", "size": 6715}
### File: osrf_pycommon/cli_utils/common.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/cli_utils/common.py", "license": "apache-2.0", "size": 6262}
### File: osrf_pycommon/cli_utils/verb_pattern.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/cli_utils/verb_pattern.py", "license": "apache-2.0", "size": 7963}
### File: osrf_pycommon/process_utils/__init__.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/__init__.py", "license": "apache-2.0", "size": 1221}
### File: osrf_pycommon/process_utils/async_execute_process.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/async_execute_process.py", "license": "apache-2.0", "size": 8992}
### File: osrf_pycommon/process_utils/async_execute_process_asyncio/__init__.py # Copyright 2016 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/async_execute_process_asyncio/__init__.py", "license": "apache-2.0", "size": 10...
### File: osrf_pycommon/process_utils/async_execute_process_asyncio/impl.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/async_execute_process_asyncio/impl.py", "license": "apache-2.0", "size": 5038}
### File: osrf_pycommon/process_utils/execute_process_nopty.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/execute_process_nopty.py", "license": "apache-2.0", "size": 5543}
### File: osrf_pycommon/process_utils/execute_process_pty.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/execute_process_pty.py", "license": "apache-2.0", "size": 3054}
### File: osrf_pycommon/process_utils/get_loop_impl.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/get_loop_impl.py", "license": "apache-2.0", "size": 2559}
### File: osrf_pycommon/process_utils/impl.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/process_utils/impl.py", "license": "apache-2.0", "size": 12584}
### File: osrf_pycommon/terminal_color/__init__.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/terminal_color/__init__.py", "license": "apache-2.0", "size": 7612}
### File: osrf_pycommon/terminal_color/ansi_re.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/terminal_color/ansi_re.py", "license": "apache-2.0", "size": 1680}
### File: osrf_pycommon/terminal_color/impl.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/terminal_color/impl.py", "license": "apache-2.0", "size": 11672}
### File: osrf_pycommon/terminal_color/windows.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/terminal_color/windows.py", "license": "apache-2.0", "size": 9919}
### File: osrf_pycommon/terminal_utils.py # Copyright 2014 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "osrf_pycommon/terminal_utils.py", "license": "apache-2.0", "size": 3516}
### File: setup.py from setuptools import find_packages from setuptools import setup install_requires = [ 'importlib-metadata;python_version<"3.8"', ] package_excludes = ['tests*', 'docs*'] packages = find_packages(exclude=package_excludes) package_name = 'osrf_pycommon' setup( name=package_name, versio...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/osrf_pycommon", "path": "setup.py", "license": "apache-2.0", "size": 1249}
### File: Makefile NAME=modern-cpp-tutorial DOCKER_ENV=changkun/$(NAME):build-env TARGET = pdf epub LANGS = zh-cn en-us ALL_BUILDS = website $(TARGET) # dep all: $(ALL_BUILDS) $(TARGET): $(LANGS) mkdir -p website/public/modern-cpp/$@/ for lang in $^ ; do \ cd $@/$${lang} && make && make clean && cd ../..; \ mv...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "Makefile", "license": "mit", "size": 817}
### File: code/1/1.1.c.and.cpp // // 1.1.cpp // // chapter 1 introduction // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include "foo.h" #include <iostream> #include <functional> int main() { // use lambda expression [out = std::ref(std::...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/1/1.1.c.and.cpp", "license": "mit", "size": 391}
### File: code/1/Makefile # # 1.1.cpp # # chapter 1 introduction # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # C = gcc CXX = clang++ SOURCE_C = foo.c OBJECTS_C = foo.o SOURCE_CXX = 1.1.c.and.cpp TARGET = 1.1.out LDFLAGS_COMMON = -std=c++2a all: $...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/1/Makefile", "license": "mit", "size": 408}
### File: code/1/foo.c // // foo.c // // chapter 1 introduction // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include "foo.h" // C code int add(int x, int y) { return x+y; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/1/foo.c", "license": "mit", "size": 230}
### File: code/1/foo.h // // foo.h // // chapter 1 introduction // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #ifdef __cplusplus extern "C" { #endif int add(int x, int y); #ifdef __cplusplus } #endif
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/1/foo.h", "license": "mit", "size": 260}
### File: code/10/10.1.without.concepts.cpp // // 10.1.without.concepts.cpp // chapter 10 cpp20 // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <list> #include <algorithm> int main() { std::list<int> l = {1, 2, 3}; // std::sort(l....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/10/10.1.without.concepts.cpp", "license": "mit", "size": 335}
### File: code/10/10.2.concepts.cpp // // 10.2.concepts.cpp // chapter 10 cpp20 // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <string> #include <vector> #include <list> using namespace std; template<typename T> con...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/10/10.2.concepts.cpp", "license": "mit", "size": 1388}
### File: code/10/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/10/Makefile", "license": "mit", "size": 244}
### File: code/2/2.01.nullptr.cpp // // 2.1.nullptr.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <type_traits> void foo(char *); void foo(int); int main() { if (std::is_same<d...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.01.nullptr.cpp", "license": "mit", "size": 896}
### File: code/2/2.02.constexpr.cpp // // 2.2.constexpr.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #define LEN 10 int len_foo() { int i = 2; return i; } constexpr int len_foo_cons...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.02.constexpr.cpp", "license": "mit", "size": 1205}
### File: code/2/2.03.if.switch.cpp // // 2.3.if.switch.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> vec = {1, 2, 3,...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.03.if.switch.cpp", "license": "mit", "size": 818}
### File: code/2/2.04.initializer.list.cpp // // 2.4.initializer.list.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <initializer_list> #include <vector> class Foo { public: int ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.04.initializer.list.cpp", "license": "mit", "size": 1577}
### File: code/2/2.05.structured.binding.cpp // // 2.5.structured.binding.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <tuple> #include <string> std::tuple<int, double, std::string...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.05.structured.binding.cpp", "license": "mit", "size": 443}
### File: code/2/2.06.auto.cpp // // 2.6.auto.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <initializer_list> #include <vector> #include <iostream> class MagicFoo { public: std::vector<int> vec; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.06.auto.cpp", "license": "mit", "size": 992}
### File: code/2/2.07.decltype.cpp // // 2.7.decltype.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <type_traits> int main() { auto x = 1; auto y = 2; decltype(x+y) z = ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.07.decltype.cpp", "license": "mit", "size": 612}
### File: code/2/2.08.tail.return.type.cpp // // 2.8.tail.return.type.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <type_traits> // before c++11 template<typename R, typename T, ty...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.08.tail.return.type.cpp", "license": "mit", "size": 933}
### File: code/2/2.09.decltype.auto.cpp // // 2.9.decltype.auto.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // template<int i> struct Int {}; constexpr auto iter(Int<0>) -> Int<0>; template<int i> constexpr aut...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.09.decltype.auto.cpp", "license": "mit", "size": 376}
### File: code/2/2.10.if.constexpr.cpp // // 2.10.if.constexpr.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> template<typename T> auto print_type_info(const T& t) { if constexpr (std::is...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.10.if.constexpr.cpp", "license": "mit", "size": 653}
### File: code/2/2.11.for.loop.cpp // // 2.11.for.loop.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> vec = {1, 2, 3, ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.11.for.loop.cpp", "license": "mit", "size": 639}
### File: code/2/2.12.external.template.cpp // // 2.12.external.template.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <vector> template class std::vector<bool>; // forcel...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.12.external.template.cpp", "license": "mit", "size": 610}
### File: code/2/2.13.alias.template.cpp // // 2.13.alias.template.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <vector> #include <string> template<typename T, typename U> class Ma...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.13.alias.template.cpp", "license": "mit", "size": 652}
### File: code/2/2.14.default.template.param.cpp // // 2.4.default.template.param.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> template<typename T = int, typename U = int> auto add(T x, U y...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.14.default.template.param.cpp", "license": "mit", "size": 366}
### File: code/2/2.15.variadic.template.param.cpp // // 2.15.variadic.template.param.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <vector> #include <string> // sizeof... template<t...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.15.variadic.template.param.cpp", "license": "mit", "size": 1251}
### File: code/2/2.16.fold.expression.cpp // // 2.16.fold.expression.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> template<typename ... T> auto sum(T ... t) { return (t + ...); } int mai...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.16.fold.expression.cpp", "license": "mit", "size": 351}
### File: code/2/2.18.non.type.template.auto.cpp // // 2.18.non.type.template.auto.cpp // chapter 2 language usability // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> template <auto value> void foo() { std::cout << value << ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.18.non.type.template.auto.cpp", "license": "mit", "size": 358}
### File: code/2/2.19.delegate.constructor.cpp // // 2.19.constructor.cpp // chapter 2 language usability // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <string> class Base { public: std::string str; int value; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.19.delegate.constructor.cpp", "license": "mit", "size": 1353}
### File: code/2/2.20.strong.type.enum.cpp // // 2.20.strong.type.enum.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> template<typename T> std::ostream& operator<<(typename std::enable_if<std::is_enum<T>::value, std::ostream...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/2.20.strong.type.enum.cpp", "license": "mit", "size": 1129}
### File: code/2/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/2/Makefile", "license": "mit", "size": 244}
### File: code/3/3.1.lambda.basic.cpp // // 3.1.lambda.basic.cpp // chapter 03 runtime enhancement // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <memory> // std::make_unique #include <utility> // std::move void lamb...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.1.lambda.basic.cpp", "license": "mit", "size": 1536}
### File: code/3/3.2.function.wrap.cpp // // 3.2.function.wrap.cpp // chapter 03 runtime enhancement // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <functional> #include <iostream> using foo = void(int); // function pointer void function...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.2.function.wrap.cpp", "license": "mit", "size": 1190}
### File: code/3/3.3.rvalue.cpp // // 3.3.rvalue.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <string> void reference(std::string& str) { std::cout << "lvalue" << std::endl; } void reference(std::string&& st...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.3.rvalue.cpp", "license": "mit", "size": 1198}
### File: code/3/3.4.historical.cpp // // 3.4.historical.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> int main() { // int &a = std::move(1); // illegal, non-const lvalue reference cannot ref rvalue const int &b = ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.4.historical.cpp", "license": "mit", "size": 370}
### File: code/3/3.5.move.semantics.cpp // // 3.5.move.semantics.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> class A { public: int *pointer; A():pointer(new int(1)) { std::cout << "construct" << pointer <...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.5.move.semantics.cpp", "license": "mit", "size": 1030}
### File: code/3/3.6.move.semantics.cpp // // 3.5.move.semantics.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> // std::cout #include <utility> // std::move #include <vector> // std::vector #include <string> // std::str...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.6.move.semantics.cpp", "license": "mit", "size": 768}
### File: code/3/3.7.perfect.forward.cpp // // 3.6.perfect.forward.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <utility> void reference(int& v) { std::cout << "lvalue reference" << std::endl; } void reference...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/3.7.perfect.forward.cpp", "license": "mit", "size": 888}
### File: code/3/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/3/Makefile", "license": "mit", "size": 244}
### File: code/4/4.1.linear.container.cpp // // 4.1.linear.container.cpp // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <array> #include <vector> void foo(int *p, int len) { for (int i = 0; i != len; ++i) { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/4/4.1.linear.container.cpp", "license": "mit", "size": 2290}
### File: code/4/4.2.unordered.map.cpp // // 4.2.unordered.map.cpp // chapter 04 containers // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <string> #include <unordered_map> #include <map> int main() { // initialize...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/4/4.2.unordered.map.cpp", "license": "mit", "size": 879}
### File: code/4/4.3.tuples.cpp // // 4.3.tuples.cpp // chapter 04 containers // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <tuple> #include <iostream> #include <variant> auto get_student(int id) { if (id == 0) return std::m...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/4/4.3.tuples.cpp", "license": "mit", "size": 2408}
### File: code/4/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/4/Makefile", "license": "mit", "size": 244}
### File: code/5/5.1.shared.ptr.a.cpp // // 5.1.shared.ptr.cpp // chapter 05 start pointers and memory management // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <memory> void foo(std::shared_ptr<int> i) { (*i)++; }...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/5/5.1.shared.ptr.a.cpp", "license": "mit", "size": 1795}
### File: code/5/5.2.unique.ptr.cpp // // 5.2.unique.ptr.cpp // chapter 05 start pointers and memory management // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <memory> struct Foo { Foo() { std::cout << "Foo::F...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/5/5.2.unique.ptr.cpp", "license": "mit", "size": 1164}
### File: code/5/5.3.weak.ptr.cpp // // 5.3.weak.ptr.cpp // chapter 05 start pointers and memory management // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <memory> class A; class B; class A { public: std::shared_...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/5/5.3.weak.ptr.cpp", "license": "mit", "size": 672}
### File: code/5/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/5/Makefile", "license": "mit", "size": 244}
### File: code/6/6.1.regex.cpp // // 6.1.regex.cpp // chapter 06 regular expression // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <string> #include <regex> int main() { std::string fnames[] = {"foo.txt", "bar.txt"...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/6/6.1.regex.cpp", "license": "mit", "size": 1352}
### File: code/6/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/6/Makefile", "license": "mit", "size": 244}
### File: code/7/7.1.thread.basic.cpp // // 7.1.thread.basic.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <thread> int main() { std::thread t([](){ std::cout <...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.1.thread.basic.cpp", "license": "mit", "size": 351}
### File: code/7/7.2.critical.section.a.cpp // // 7.2.critical.section.a.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <mutex> #include <thread> int v = 1; void critical_s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.2.critical.section.a.cpp", "license": "mit", "size": 634}
### File: code/7/7.3.critical.section.b.cpp // // 7.3.critical.section.b.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <mutex> #include <thread> int v = 1; void critical_s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.3.critical.section.b.cpp", "license": "mit", "size": 823}
### File: code/7/7.4.futures.cpp // // 7.4.futures.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <thread> #include <future> int main() { // pack a lambda expression tha...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.4.futures.cpp", "license": "mit", "size": 739}
### File: code/7/7.5.producer.consumer.cpp // // 7.5.producer.consumer.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <queue> #include <chrono> #include <mutex> #include <thread> #include <iostr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.5.producer.consumer.cpp", "license": "mit", "size": 1754}
### File: code/7/7.6.atomic.cpp // // 7.6.atomic.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <atomic> #include <thread> #include <iostream> std::atomic<int> count = {0}; int main() { st...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.6.atomic.cpp", "license": "mit", "size": 558}
### File: code/7/7.6.bad.example.cpp // // 7.6.bad.example.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <thread> #include <iostream> int main() { int a = 0; volatile int flag = 0; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.6.bad.example.cpp", "license": "mit", "size": 525}
### File: code/7/7.7.is.lock.free.cpp // // 7.7.is.lock.free.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <atomic> #include <iostream> struct A { float x; int y; long long z; }; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.7.is.lock.free.cpp", "license": "mit", "size": 398}
### File: code/7/7.8.memory.order.cpp // // 7.8.memory.order.cpp // chapter 7 parallelism and concurrency // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <atomic> #include <thread> #include <vector> #include <iostream> using namespace std;...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/7.8.memory.order.cpp", "license": "mit", "size": 2692}
### File: code/7/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/7/Makefile", "license": "mit", "size": 244}
### File: code/9/9.1.noexcept.cpp // // 9.1.noexcept.cpp // chapter 09 others // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> void may_throw() { throw true; } auto non_block_throw = []{ may_throw(); }; void no_throw() no...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/9/9.1.noexcept.cpp", "license": "mit", "size": 1120}
### File: code/9/9.2.literals.cpp // // 9.2.literals.cpp // chapter 09 others // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> #include <string> std::string operator"" _wow1(const char *wow1, size_t len) { return std::string(...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/9/9.2.literals.cpp", "license": "mit", "size": 748}
### File: code/9/9.3.alignment.cpp // // 9.3.alignment.cpp // chapter 09 others // modern c++ tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> struct Storage { char a; int b; double c; long long d; }; struct ali...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/9/9.3.alignment.cpp", "license": "mit", "size": 528}
### File: code/9/Makefile # # modern cpp tutorial # # created by changkun at changkun.de # https://github.com/changkun/modern-cpp-tutorial # all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) %.out: %.cpp Makefile clang++ $< -o $@ -std=c++2a -pedantic clean: rm *.out
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "code/9/Makefile", "license": "mit", "size": 244}
### File: docker/Dockerfile FROM node:latest LABEL "maintainer"="Changkun Ou <hi[at]changkun.de>" LABEL "repository"="https://github.com/changkun/modern-cpp-tutorial" LABEL "homepage"="https://changkun.de/modern-cpp/" # For Unicode ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 WORKDIR /modern-cpp-tutorial # Node & Npm & Pyth...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Dockerfile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "docker/Dockerfile", "license": "mit", "size": 536}
### File: epub/en-us/Makefile title = 'Modern C++ Tutorial: C++11/14/17/20 On the Fly' filename = 'modern-cpp-tutorial' outputname='modern-cpp-tutorial' revision = $(shell git describe --always --tags) date = $(shell date +'%Y.%m.%d-%H:%M') all: revision epub revision: @echo '---' >> meta.markdown @echo 'title: "Mod...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "epub/en-us/Makefile", "license": "mit", "size": 1702}
### File: epub/en-us/filter.py # !/usr/bin/env python3 # author: changkun<hi[at]changkun.de> import os chapters = ['00-preface.md', '01-intro.md', '02-usability.md', '03-runtime.md', '04-containers.md', '05-pointers.md', '06-regex.md', '07-thread.md', '08-filesystem.md', '09-others.md', '10-cpp20.md', 'appendix1.md'...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "epub/en-us/filter.py", "license": "mit", "size": 758}
### File: epub/zh-cn/Makefile title = '现代 C++ 教程:高速上手 C++11/14/17/20' filename = 'modern-cpp-tutorial' outputname='modern-cpp-tutorial' revision = $(shell git describe --always --tags) date = $(shell date +'%Y.%m.%d-%H:%M') all: revision epub revision: @echo '---' >> meta.markdown @echo 'title: "现代 C++ 教程:高速上手 C++11...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "epub/zh-cn/Makefile", "license": "mit", "size": 1679}
### File: epub/zh-cn/filter.py # !/usr/bin/env python3 # author: changkun<hi[at]changkun.de> import os chapters = ['00-preface.md', '01-intro.md', '02-usability.md', '03-runtime.md', '04-containers.md', '05-pointers.md', '06-regex.md', '07-thread.md', '08-filesystem.md', '09-others.md', '10-cpp20.md', 'appendix1.md'...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "epub/zh-cn/filter.py", "license": "mit", "size": 753}
### File: exercises/2/fold.expresion.cpp // // fold.expression.cpp // // exercise solution - chapter 2 // modern cpp tutorial // // created by changkun at changkun.de // https://github.com/changkun/modern-cpp-tutorial // #include <iostream> template<typename ... T> auto average(T ... t) { return (t + ... ) / sizeo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/modern-cpp-tutorial", "path": "exercises/2/fold.expresion.cpp", "license": "mit", "size": 374}