ajbennieston / cpp Goto Github PK
View Code? Open in Web Editor NEWAn open C++ course
License: Other
An open C++ course
License: Other
Day 2, page 9
In C++11, thread local joins static, dynamic and automatic storage durations.
e.g. day 2, page 8
... and discuss this syntax in the footnote dedicated to the MVP.
We're testing in.eof() but probably shouldn't be.
See:
(Instead of SGI's STL pages)
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)
They are literals, and also keywords...
(Page 8, day 1)
Hopefully NULL isn't used anywhere, but 0 definitely is. Use nullptr to initialise all pointers (except those that already get initialised to something meaningful) in order to demonstrate C++11.
LaTeX can make beautiful tables. The ones in these notes are awful. Make them look better!
Replace any occurrences of "template class" with "class template" (if any).
Perhaps describe iterators first, then say that a pair of pointers can act as iterators, then explain pointers properly?
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.
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.
(Which saves pain with templates)
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.
With member functions for both cartesian and polar coordinates
(Day 3, page 12)
"A constructor must be called" (middle of page) is wrong, e.g.
string s = "Test";
e.g. n as template param.
cin.clear() followed by cin.ignore() is a fairly standard approach. Using streamsize max is also fairly standard. One alternative would be to use cin.rdbuf()->in_avail() i.e. the number of characters in the input buffer.
See:
In some cases (e.g. day 4 notes) they are currently before the stop, and look bad.
Some of the pages of the notes have overfull hboxes (text running into the right margin, and beyond). Fix this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.