4 ms·
Scott Meyers also suggests the same sort of thing in Effective Modern C++ when not using an IDE. Personally, I use the technique a lot for debugging template e
by danbolt 7y ago
Scott Meyers also suggests the same sort of thing in Effective Modern C++ when not using an IDE.
Personally, I use the technique a lot for debugging template errors in the language.
- stochastic_monk 7y agoSpecifically: template<typename T> struct TD; Instantiate this as ‘TD<decltype(foo)>’ to get the full name of the type. Rust’s does seem more concise.
- edflsafoiewq 7y agoNote that you don't get the full name of the type with a bad assignment in Rust, you only get the part of the type that was deduced before type checking failed. A generic type might have undeduced blanks, eg. Vec<_>. A side-effect of type inference.