January 2019
Intermediate to advanced
512 pages
14h 5m
English
The idea of writing a program without explicit type information is certainly not new. In fact, it predates object-oriented programming and the notion of objects by a long time. Consider this C program (no C++ here) as an example:
int less(const void* a, const int* b) { return *(const int*)a - *(const int*)b;}int main() { int a[10] = { 1, 10, 2, 9, 3, 8, 4, 7, 5, 0 }; qsort(a, sizeof(int), 10, less);}
Now remember the function declaration for qsort from the standard C library:
void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
Note that, while we are using it to sort an array of integers, the qsort function itself does not have any explicit types—it uses void* to pass in the ...