Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their way to become runtime problems are harder to detect and may go unchecked until such time that the code reaches a customer. The later the defect is identified the more costly it is in terms of time and money.
Tag: cpp
Determining if a C++ type is convertible to another at compile time
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generate a log or trace file for debugging purposes. The relationship of the types may have significance.
Continue reading “Determining if a C++ type is convertible to another at compile time”
Stop Reinventing C++ Wheels!
Necessity is the mother of invention
One thing that always amazes me is how often I see C++ programmers reinvent the wheel. The times I’ve seen engineers writing yet another sort routine or implementing their own version of a linked list, because they have a “special case” that necessitates it, just beggars belief. A “special case”? Really? Come on!
