From 8bf6f611d85ef35af1540ec4acd3adbc0e5f3303 Mon Sep 17 00:00:00 2001 From: Geert Jan Bex Date: Fri, 8 Mar 2024 13:03:42 +0100 Subject: [PATCH 1/4] Use structured binding rather than std::tie --- source-code/Boost/ProgramOptions/random_default.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source-code/Boost/ProgramOptions/random_default.cpp b/source-code/Boost/ProgramOptions/random_default.cpp index 8bd450d..dcb35ea 100644 --- a/source-code/Boost/ProgramOptions/random_default.cpp +++ b/source-code/Boost/ProgramOptions/random_default.cpp @@ -9,10 +9,7 @@ using Options = std::tuple; Options get_options(int argc, char* argv[]); int main(int argc, char* argv[]) { - int n; - double a, b; - size_t seed; - std::tie(n, a, b, seed) = get_options(argc, argv); + auto [n, a, b, seed] = get_options(argc, argv); std::mt19937 engine(seed); std::uniform_real_distribution distr(a, b); From 20bd09a72766630ef102b2746caee71480af1702 Mon Sep 17 00:00:00 2001 From: Geert Jan Bex Date: Fri, 8 Mar 2024 13:10:15 +0100 Subject: [PATCH 2/4] Fix typos --- scientific_cpp.pptx | Bin 1029115 -> 1029122 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/scientific_cpp.pptx b/scientific_cpp.pptx index eba8d4657245a4b464511f046e6a5aebe9ad6a16..e61444dc4287895a714b2d37203da8e0d18ecedb 100644 GIT binary patch delta 13199 zcmZXa1y~eO+rQlj5rGBimK?fUQoyBKx{;8O5D-Zb z1yPXiti${LulM_VU3-o9{rsM@=giCwEHi(;$i7;W_4Y&fA^q_D@cjs?2ty4?9^d@f zy-j@P%ri}>HHeT7TVhCPj)%!X^%68}cYc+K7^7a#Vrgmcl2nw-{uC*vu77rncQPNZ z##nLW&eoav5Dyd9tz2g2sC%?Gm^N(>z9=(4JGK}(wiF7pYj(msTl4>`ofDFo$V^tS z_?&U(Y_&sLq|u~StqcAI{y;=hKf51dPZ6I^=U&4R!*zVKg*wjO86!H3ro>UQ;NN!v z&UIOfotb9>slJ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j9s)J6zlebin**Y!XJ{|BEbBx00=r!5F7{rbtDJ@K@c7YWIU(Vzz& z1;Hu`1fwAkd;tYirK{cRU}U=BwNOUGI+&ZjtXZSB)i3c&2q#; z(1`*a00Qb*5Hu4Yut0%YA_R3PP)>p%A_;8w&soeI2OfIGWJnH624(OP{hx0Qu*eiB zRu~87ho?etf`Xhh2)?I5MG^zX@nB<_>5x2`4$9!Iitf+14_I9WB(KJUsqZr(*vSMv z|2iXPvY=Q902-&VA(%kHL=FV(2_TH+LO`7NpPHBQ{<=dC=RpR-e9-XceEw(H5A&fI zcL5mtGee=CMgQmazE=PlZWV%tzrP#6Xo{d%T_RWpWibS}Ng$AyKpsAVRy-~vvSJ7{Rv|C!ssf0+P?RB%Grst5Gbz;3)s z1;3B>HUV=P;1}vBI1ULgkP0?7-27jK6u6lNK2c8qdTEF!upfV2w& zu$e!1j&(vDVxTJ@frma0a29};eIm$GPyp_hm>AeC1h0gj1z>;j0k%SfIC>~xS%{E8 zp8-lyn^a(@5FraYr-h8FMc}V3y;pI7ovS!kfV3h62Ut#L5keB34j?QB{eHkR)aC?; z0XG-~Qn0Cez@7Gn^?=wra4hu!Kh)*{@cA7mVgPuR;8=zeB7h1) c#1+7#5-eu}h^hoFJHSXKf(^Ti9s#!be;s=|Jpcdz From 7c2bcb31118e8fa7554805eaea9e3ee19b227bc1 Mon Sep 17 00:00:00 2001 From: Geert Jan Bex Date: Fri, 8 Mar 2024 13:15:21 +0100 Subject: [PATCH 3/4] Add copy and move assignement operator --- source-code/UserDefinedTypes/ObjectLifeCycle/emplace.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source-code/UserDefinedTypes/ObjectLifeCycle/emplace.cpp b/source-code/UserDefinedTypes/ObjectLifeCycle/emplace.cpp index c539537..6aff165 100644 --- a/source-code/UserDefinedTypes/ObjectLifeCycle/emplace.cpp +++ b/source-code/UserDefinedTypes/ObjectLifeCycle/emplace.cpp @@ -4,7 +4,9 @@ struct S { S() { puts("S()"); } S(const S&) { puts("S(&)"); } + S& operator=(const S&) { puts("S=&"); return *this; } S(S&&) { puts("S(&&)"); } + S& operator=(S&&) { puts("S=&&"); return *this; } ~S() { puts("~S()"); } }; From aec75bd2a19dedac9081b1e614b61234de55715a Mon Sep 17 00:00:00 2001 From: Geert Jan Bex Date: Fri, 8 Mar 2024 13:30:39 +0100 Subject: [PATCH 4/4] Replace make by CMake build --- .../ObjectLifeCycle/CMakeLists.txt | 11 +++++++++++ .../UserDefinedTypes/ObjectLifeCycle/Makefile | 15 --------------- .../UserDefinedTypes/ObjectLifeCycle/README.md | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 source-code/UserDefinedTypes/ObjectLifeCycle/CMakeLists.txt delete mode 100644 source-code/UserDefinedTypes/ObjectLifeCycle/Makefile diff --git a/source-code/UserDefinedTypes/ObjectLifeCycle/CMakeLists.txt b/source-code/UserDefinedTypes/ObjectLifeCycle/CMakeLists.txt new file mode 100644 index 0000000..3ded173 --- /dev/null +++ b/source-code/UserDefinedTypes/ObjectLifeCycle/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.20) + +project(object_life_cycle LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +add_executable(gadget.exe gadget.cpp) + +add_executable(emplace.exe emplace.cpp) diff --git a/source-code/UserDefinedTypes/ObjectLifeCycle/Makefile b/source-code/UserDefinedTypes/ObjectLifeCycle/Makefile deleted file mode 100644 index be01bb8..0000000 --- a/source-code/UserDefinedTypes/ObjectLifeCycle/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CXX = g++ -CXXFLAGS = -std=c++17 -O2 -g -Wall -Wextra -CPPFLAGS = -MMD -MP -LDLIBS = -lm - -all: gadget.exe emplace.exe - -%.exe: %.o - $(CXX) $(CXXFLAGS) -o $@ $^ $(LDLIBS) - --include $(wildcard *.d) - -clean: - $(RM) $(wildcard *.exe) $(wildcard *.o) $(wildcard *.d) - $(RM) core $(wildcard core.*) diff --git a/source-code/UserDefinedTypes/ObjectLifeCycle/README.md b/source-code/UserDefinedTypes/ObjectLifeCycle/README.md index e95bfcb..3468579 100644 --- a/source-code/UserDefinedTypes/ObjectLifeCycle/README.md +++ b/source-code/UserDefinedTypes/ObjectLifeCycle/README.md @@ -7,4 +7,4 @@ copy constructors, copy assignment, and copy elision. 1. `gadget.cpp`: driver function to illustrate the various life cycle scenarios of an object. 1. `emplace.cpp`: example of using emplace for vectors. - 1. `Makefile`: make file to build the application. + 1. `CMakeLists.txt`: CMake file to build the application.