Re:“C is how the computer works” is a dangerous mindset for ...
by saagarjha on Tuesday March 31, 2020 @11:25PM
(#22745340)
No, I know what you're talking about; this is an issue in general if you'd not using tooling that's aware of the ins and outs of C++. The point is that the IDEs I have used essentially run the compiler on the file, so they can actually understand what the templates are doing and get through them.
[ Parent
| on HN ]
Re:“C is how the computer works” is a dangerous mindset for ...
by Too on Wednesday April 01, 2020 @12:55AM
(#22745842)
Templates can inherently not be understood. It's duck typing 3 degrees of freedom with 3 unknowns. You need concepts which adds 1 known into the equation, (the final missing degree of freedom is the dreaded ctrl-click-into-an-interface-instead-of-the-concrete-class which is hard to avoid). Tell me one IDE that will give any meaningful information about buzz in the example below:
template<typename T>
void foo(T bar) { bar.buzz(); }
Other than that, finding foo<T> is usually easy, i've had good experience with qtcreator or clangd, you just have to be very very sure that your include paths are correct, qtcreator is good in that it uses CMakeLists as project-files so all this is done automaticaly.