Skip to content

Commit

Permalink
bettered a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
lformaggia committed Aug 20, 2024
1 parent f91ae9c commit b3d355e
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 153 deletions.
4 changes: 2 additions & 2 deletions Examples/src/STL/InitializerList/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ An inizialiser list can be constructed using *brace initialization*, and this a

Indeed, in this example we show how an object of a `Poly` class, meant to be a simple class storing a polygon defined by its vertices, can be initialised with the wanted vertices using braces. We show also that indeed `initializer_list<T>` may be used not just for initialization!

#What do you learn here?#
A little utility of the Standard Library, meant to simplify life.
# What do you learn here? #
A little utility of the Standard Library, meant to mak ethe initialization of container-type structure more uniform.
9 changes: 6 additions & 3 deletions Examples/src/STL/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Some utilities of the standard library#
# Some utilities of the standard library #

Some code examples in this directory are modified version of those in
*The C++ Standard Library - A Tutorial and Reference, 2nd Edition"
Expand Down Expand Up @@ -35,15 +35,18 @@ It contins also an example of use of `std::visit()`.
* `SortAndPermute` An useful utility if you need to sort a vector and keep track of the performed
permutation to be able to apply it to other vectors.

* `Streams` A set of examples on streams, including binary i/o.
* `Span` A simple example descibing the `std::span` utility introduced in C++20 that provides a view over a contiguous sequence of elements and is a lightweight, non-owning reference to an array or a portion of an array.

* `Streams` A set of examples on streams, including binary i/o and string streams. In the example contained in `binary_io/` also show the use of an utility declared in `Utilities/string_utility.hpp`
that allows to read a whole file in a string.

* `Map` A simple program that shows the main functionalities of `std::map`

* `InitializerList` An simple example that explains how the use of `std::initializer_list<T>` can simplyfy construction of object that stores containers to be filled in the construction.



#What do I lean here?#
## What do I learn here? ##

- A few standard algorithms, of the many;
- The use of different comparison operators for ordered containers (an example of the Strategy design pattern).
Expand Down
Loading

0 comments on commit b3d355e

Please sign in to comment.