4 ms·
CTL just copy pastes a bunch of code via an include for each new type. The following two tidbits are basically the same thing: CTL #define P #define
by glouwbug 5y ago
CTL just copy pastes a bunch of code via an include for each new type. The following two tidbits are basically the same thing:
CTL
#define P
#define T int
#include <vec.h>
STL
#include <vector>
template class std::vector<int>;
C++ with its STL is just dramatically slower at compiling it all. C loves to chew through its basic syntax and O(1) lookup since every symbol is essentially unique (take that C++ and your function overloading!)