From bab12f46522786031527c971cf5dd005efc7a9d0 Mon Sep 17 00:00:00 2001 From: "Stephen M. McQuay" Date: Sat, 5 May 2012 09:36:42 -0600 Subject: [PATCH] added my notes --- notes.rst | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 notes.rst diff --git a/notes.rst b/notes.rst new file mode 100644 index 0000000..fcff443 --- /dev/null +++ b/notes.rst @@ -0,0 +1,80 @@ +===== +C++11 +===== + +.. rubric:: oh dear, it burns + +- Approved 2011-08-12 +- for some time called c++0x +- references: primarily the `wikipedia article`_ on c++11 + +.. _`wikipedia article`: http://en.wikipedia.org/wiki/C%2B%2B11 + + +constexpr +========= + +- see example with/without -std=c++0x +- see wiki for limitations +- constructors of user-defined types can be declared constexpr + +initializer lists +================= + +- see example with/without -std=c++0x +- initializer_list<> + - constructed, copied, only by ref + +type inference +============== + +- auto keyword +- decltype + +new string literals +=================== + +- u8"I'm a UTF-8 string." +- u"This is a UTF-16 string." +- U"This is a UTF-32 string." + +tuple fun +========= + +- #include +- make_tuple +- tie + +lambdas +======= + +- see `c++11 anonymous funcs`_ +- [capture](arguments) -> return-type {body} +- capture: + - [] capture nothing + - [x, &y] x by value, y by reference + - [&] any external variable captured by ref + - [=] any external variable captured by val + - [&, x] x by val, everything else by ref + - [=, &x] x by ref, everything else by val + +.. _`c++11 anonymous funcs`: http://en.wikipedia.org/wiki/Anonymous_function#C.2B.2B + +regular expressions and threading +================================= + +- this is where the burning starts ... + +rvalue +======= + +- pass-by-value is deep-copy (usually) +- c++11 adds notion of "move constructor" + - takes the rvalue ref's stuff and nullifies the rvalue + - 'safe and invisible' (because it's null, memory is not del'd when it goes + out of scope) +- rvalue is automatic when using stuff with "move constructor" +- std::move() + +Smart Pointers +==============