5 ms·
Modern gdb does have Python plug-ins, and e.g. I'll get "std::vector of length 3, capacity 4 = {10, 20, 30}" when printing a vector, and "std::shared_ptr (count
by stevedonovan 10y ago
Modern gdb does have Python plug-ins, and e.g. I'll get "std::vector of length 3, capacity 4 = {10, 20, 30}" when printing a vector, and "std::shared_ptr (count 1, weak 0) 0x8059e10" when printing a shared ptr. But oh yes, it could be so much better. For instance, often you cannot call methods on template stuff (that is, everything) because 'it may be inlined'
- microcolonel 10y ago"May" ought to be translated as "must". Templated C++ is incredibly sluggish without inlining. People are comfortable debugging C programs with more advanced optimizations turned off because performance will still be decent. In C++, the optimizations are the only reason it ever performs reasonably.
- ccurtsinger 10y agoNot really. Calling a C++ template-generated function is no different than calling a C function. If you have a lot of tiny template-generated functions then sure, it would be slow. But no slower than a C program with a bunch of tiny functions.
- doomrobo 10y agoMaybe they are thinking of specializing for static dispatch?