4 ms·
Our codebase is a few hundred thousand lines of C++. I think we use enable_if two or three times. Templates are used when necessary. I've been paid to write C++
by secondcoming 6y ago
Our codebase is a few hundred thousand lines of C++. I think we use enable_if two or three times. Templates are used when necessary. I've been paid to write C++ for about 15 years at this stage, and I still regulary refer to example code online. And if you want to see exactly what the compiler's doing to with your code use Compiler Explorer.
- gumby 6y ago> And if you want to see exactly what the compiler's doing to with your code use Compiler Explorer. With real code (with a build system, various includes, and likely your employer's proprietary code you aren't allowed to upload to some web site) it's usually far simpler to simply use -S or --save-temps. Sometimes you can make a toy case or take a sample from your employer's code base and paste it into godbolt. It's very rare for most users to want to see the assembly code.
- secondcoming 6y ago> It's very rare for most users to want to see the assembly code. Maybe, but if I'm hiring a C++ programmer I'd expect them to want to do this occasionally.