Giter Site home page Giter Site logo

cpp's People

Contributors

ajbennieston avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

cpp's Issues

Add discussion of alternate form of op+, etc.

Already show:

T operator+(const T& lhs, const T& rhs)
{
  T tmp(lhs);
  tmp += rhs;
  return tmp;
}

Should also mention:

T operator+(T lhs, const T& rhs)
{
  return lhs += rhs;
}

And be careful to point out the difference in parameter types (i.e. lhs is a copy, rhs is a reference)

Fix shadowing example

In day2/code/01-shadowing.cpp the example given produces a compiler error due to redefinition; need a better example that actually shows shadowing.

The code file has a FIXME comment to this effect.

C++11: fstream constructor now accepts std::string

As of C++11, there is a constructor for basic_fstream that accepts string arguments. This is in addition to the C++98 constructor that accepts const char* arguments.

Constructing fstream objects is discussed in the day 4 notes, but there could be other instances where this can be updated.

C++11: Use auto in limited scenarios where appropriate

Use auto where appropriate, e.g. for iterators or other complex types. Avoid using it everywhere, since the code is meant to provide an example, rather than actually be compiled and used, so having type information visible is useful.

Split out code from text

  • Split all of the code samples out into separate files
  • Write script to include the marked section(s) into the TeX source on build
  • Write surrounding code to make each piece of code complete
  • Write Makefile to build each piece of code so it can be (automatically) checked for correctness

Fix overfull hboxes

Some of the pages of the notes have overfull hboxes (text running into the right margin, and beyond). Fix this.

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.