Giter Site home page Giter Site logo

beginning-cpp20's Introduction

Apress Source Code

This repository accompanies Beginning C++20 by Ivor Horton and Peter Van Weert (Apress, 2020).

Cover image

Download the files as a zip using the green button, or clone the repository to your machine using Git. To make sure you also clone the 3rd party submodules in the Workarounds directory, we recommend using the following Git command:

git clone --recursive https://github.com/Apress/beginning-cpp20.git

C++20 Compiler Support

At the time the book was completed, not a single compiler supported all C++20 features yet. We recommend you consult the Workarounds section on how to work around any compilation issues you may experience.

Contributions

See the file Contributing.md for more information on how you can contribute to this repository.

beginning-cpp20's People

Contributors

eccentricon avatar markp88 avatar peter-vanweert avatar quadruplealpha 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beginning-cpp20's Issues

#include <format>

  1. env:
gcc --version
gcc (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  1. error:
cd "/root/ws/beginning-cpp20/Examples/NoModules/Chapter 02/" && g++ -std=c++20 Ex2_03B.cpp -o Ex2_03B.exe && "/root/ws/beginning-cpp20/Examples/NoModules/Chapter 02/"Ex2_03B.exe
Ex2_03B.cpp:3:10: fatal error: format: No such file or directory
    3 | #include <format>
      |          ^~~~~~~~
compilation terminated.

  1. cppreference

cppreference

  1. my opinion

It's like a joke

Does the chapter 13 page 495 definning postfix operator++ wrong?

I'm sorry to bother you, but I found a problem here. in the page 495, we define a postfix operator++.
屏幕截图 2023-11-15 200619

But when I run the code, the compiler warned that the variable copy is a local variable, which caused segementation fault.
屏幕截图 2023-11-15 200208

emm, I tried to change the copy to static and it worked. But you know, only once.
屏幕截图 2023-11-15 200116
So, how can I define a right version of the operator?

Exercise 2-4 code wrong?

For the exercise 2-4 answer, a person's height in meters is calculated as this:

h_meters { meters_per_foot * h_feet + h_inches / inches_per_foot };

This converts the recorded feet to meters, but then converts the recorded inches to feet and adds feet to meters, which doesn't make sense. I believe this leads to incorrect BMI values.

It should be this:

h_meters { meters_per_foot * (h_feet + h_inches / inches_per_foot) };

std::format is not implemented

None of the major vendors implements the format header yet. Hence, none of the book examples that use them work at the moment. There is a workaround by using fmt library, however requires extra work. Please update the appendix and provide clear instructions to install the fmt library to make the examples work. Or replace the std::format examples with stream formatting.

No offense, but has anyone tried to compile the source code? This is a minimum effort required to do when writing a book aimed at "beginners".

book errata - ASCII Codes

Where can errata get submitted for the book?

page 21 - ASCII Codes

lowercase letters have the sixth bit as 0, and uppercase letters have the sixth bit as 1

This should be

lowercase letters have the sixth bit as 1, and uppercase letters have the sixth bit as 0

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.