Coder Social home page Coder Social logo

counting-in-cpp's Introduction

Counting from 98 to 14 in C++

This book is a (quite opinionated) overview of many features added in the C++ language and the standard library since the huge major update called C++11.

Get the PDF here., or read it online.

My hope is that the reader will find here an intermediate view on the language, between the cold factual description from the standard and the various low level subtleties one can find on various forums and blogs. So, if by reading this book you learn something about the language or if you suddenly understand why some feature has been added at some point, I will have completed my mission. Additionally, I will sometimes complete a section with personnal or critical comments based on my own experience.

The sections are quite short and suppose some basic knowledge of the language (pre-11 knowledge is enough). The casual C++ programmer will appreciate skimming through its content to get an overview the available tools.

Please note that only C++11 is covered in the current state of this document.

Contributing

Writing is hard, and at some point sentences and words become a fog of blurry shapes where I can't even see my own words. Sometimes also, the mood is not there and the tone becomes harsh. If you find any typo or badly formulated sentences, feel free to open a pull request.

Large contributions are a delicate topic. Since the book is full of my personal opinion, and since my name is on the cover, I probably cannot accept biased contributions unless I fully agree with their author. If you want to address a topic, please do it in a neutral way.

Finally, if you want to add a section about a not yet discussed feature, please do it. The idea is to present the features in a kind of tangible way, preferably based on the experience of someone actually using it in production code.

License

The book is available under the terms of the Creative Commons Attribution-Share Alike 4.0 International License.

Note that I don't require the transfer of copyright ownership on the contributions, so a good way to keep this book forever free is simply to contribute! (wink).

counting-in-cpp's People

Contributors

alkino avatar j-jorge avatar maddimax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

counting-in-cpp's Issues

Improvement for comparison operator

In section "2.5.12 Hash tables", you write a comparison operator for color. There is a better (and more safe) way to do it:

bool operator<(const color& that) const {
  std::tie(red, green, blue) < std::tie(that.red, that.green, that.blue);
}

std::tie creates a std::tuple which already implements operator< with lexicographical order.

You do not talk about std::tie but it's the C++11 way of doing structured binding. It's a very good alternative to std::get.

Navigation in web version

Hi there, great resource for someone re-learning modern C++. Some quick feedback that I hope you don't mind. As a reader I found two things that made me switch to the PDF version over the web version:

  1. The amount of text before having to hit next is often a too little because the structure emphasizes the full tree of the doc (e.g. https://julien.jorge.st/counting-in-cpp/counting-in-c++ch3.html and https://julien.jorge.st/counting-in-cpp/counting-in-c++se8.html#x13-120002.1 and https://julien.jorge.st/counting-in-cpp/counting-in-c++su1.html#x14-14000)
  2. Related to the first point, going from one page to the next page is often difficult as the reader has to navigate up then across the tree. E.g. try navigating just using links from the last page of chapter 2 (or is it 3) to the first of 3(4?) https://julien.jorge.st/counting-in-cpp/counting-in-c++su43.html#x61-1280002.6.9 to https://julien.jorge.st/counting-in-cpp/counting-in-c++su1.html#x14-130002.1.1

Incidentally the chapter numbers don't match the URL.

Some possible fixes:

  1. Add a next link that goes to the next page in DFS order
  2. Combine the full section (e.g. 2.1) instead of showing the individual pages (e.g. 2.1.1),

Missing argument in an example

First !

In section "2.5.1 Functions", in the first example, there is an argument missing on the line scheduled.push_back(std::bind(&5));. Looking at the next example, I thing it should be scheduled.push_back(std::bind(&bar, &5));.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.