Video Coming Soon...
59: You Don't Need Constructors
This exercise is pending. Quick notes about this exercise:
- Talk about why C++ has the odd syntax to pre-initialize variables
- Show how you can use default initialization and designated initializers to avoid constructors.
- Talk about why you want to do this.
- Demonstrate that it's a performance gain most of the time.
The Code
See how I did it.
View Source file ex59.cpp Only#include <fmt/core.h>
#include <chrono>
#include <thread>
#include <string>
int main(int argc, char* argv[]) {
fmt::println("HELLO!");
}
The Breakdown
line of code- Description.
The Discussion
Blah blah.
Further Study
- Do this next.
Register for Learn C++ the Hard Way
Register to gain access to additional videos which demonstrate each exercise. Videos are priced to cover the cost of hosting.