This folder, attic, contains code fragments.
Like most attics, this attic needs a good cleaning.
Some fragments are from the usual places on the web, cplusplus.com, stackoverflow, etc.
Some fragments are DIY code written in class.
Some fragments are as-is as found on the web while others are heavily modified to make work or add functionality.
Some fragments are useful, some are not.
Most fragments work, some don't.
Notable Useful Fragments
fastforward.cpp - a summary of OOP345.
funcptr.cpp - examples of the many ways of passing function names to other functions: direct call, c-style function pointer, c++-style function pointer, function object (functor), lambda, bind examples of interesting functions to pass function to: thread, async, packaged_task
sp?.cpp - smart pointer resources
mi-*.cpp - multiple inheritance resources, clone+diamond problem
template-simple.cpp - simple example of class and function template
theading?01?.cpp - threading101?.cpp - basic threading, mutexes - threading201?.cpp - futures and promises - threading301?.cpp - async, packaged_task - threading401?.cpp - how things were done before async + packaged task
thread-*.cpp - cool thread code, such as thread pools
ll*.cpp - linked list code
cirq.cpp - circular linked list or q
moveSimple.cpp - move semantics
stl-calc-*.cpp - postfix calculator using stl stack, list, vector, deque containers
vectorchar*.cpp - how to make a string class based on std::vector
dp-composite*.cpp - composite (tree) design pattern code
alarmsetjmp.cpp + setjmp*.cpp - use alarm and setjmp to do interesting things
swap.cpp - swapping data in place (without using a temporary) using xor and add operators.
asmlist.cpp - how to generate an in-line assembler listing of the code generated by the compiler
popen.cpp - how to start up a pipe to a program and read the output from the program
ocl_c++11.cpp - how to run a minimal OpenCL program on a GPU using C++11 features
folder threading-concurrency_in_action - pdf and sample code from Concurancy in Action book