Skip to content

Commit

Permalink
Merge pull request #25 from gjbex/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
gjbex authored Mar 8, 2024
2 parents 99ab78a + 9272ae6 commit 2651564
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
Binary file modified scientific_cpp.pptx
Binary file not shown.
5 changes: 1 addition & 4 deletions source-code/Boost/ProgramOptions/random_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ using Options = std::tuple<int, double, double, size_t>;
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<double> distr(a, b);
Expand Down
11 changes: 11 additions & 0 deletions source-code/UserDefinedTypes/ObjectLifeCycle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 0 additions & 15 deletions source-code/UserDefinedTypes/ObjectLifeCycle/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion source-code/UserDefinedTypes/ObjectLifeCycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions source-code/UserDefinedTypes/ObjectLifeCycle/emplace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()"); }
};

Expand Down

0 comments on commit 2651564

Please sign in to comment.