Theory questions for TDDD38 2016-08-17 1. By returning a raw pointer, we will leave it up to the user of our function to deallocate the resource. The problem here is of course that a raw pointer could also point to some static memory that cannot be deallocated. 2. a constexpr funciton is a function that the compiler can calculate at compile time to create constant values. constexpr int foo(int n) { return n+1; } The return value can be used where the compiler requires a constant expression, such as a template argument: std::array arr; 3. struct Foo { Foo(int a) : f_b{a}, f_a{f_b+2} {} int f_a; int f_b; }; This might look correct, but the compiler will always initialize the members in declaration order which means that f_a will be initialized first using a "random" (uninitialized) value of f_b before f_b is initialized. 4. class X { operator int(); }; 5. It has to be a template class that takes exactly two template arguments. One simple example is pair: pair It will not work for map (takes four arguments but have defaulted values)