1. If a variable is declared as constexpr, will its value be set at compile time?
constexpr
static
2. How do move semantics contribute to the efficiency of classes with value semantics?
3. If you want to use value semantics on objects of a custom class, which of the following is most important to implement?
operator<<
4. Which standard C++ library provides time-based tools that can be used for benchmarking?
<chrono>
<measure>
<record>
<metrics>
<snapshot>
5. What is a common pitfall when writing a microbenchmark in C++?
6. What is the standard way to implement custom memory allocation in C++?
new
delete
malloc
free
7. Which of the following factors would make it impossible to effectively profile a function?
8. Many std::string implementations maintain an instance of the empty string rather than just using a null pointer. Why?
std::string
9. What is small string optimization?
10. How does if constexpr differ from a regular if statement?
if constexpr
if
Click Check Answers to identify any errors and try again. Click Show Answers if you also want to know which answer is the correct one.