Random Link ¯\_(ツ)_/¯ | ||
May 30, 2022 | » | Templates in C++
4 min; updated May 30, 2022
A template is a class or a function that we can parameterize with a set of types or values. Parameterized Types The vector-of-doubles can be generalized to a vector-of-anything type by making it a template: // `template<typename T>` can be read as "for all types T". Older code // uses `template<class T>`, which is equivalent. template<typename T> class Vector { public: explicit Vector(int s); ~Vector() { delete[] elem; } // .... |
Feb 19, 2022 | » | Learning Haskell via AoC 2021
17 min; updated Feb 19, 2022
This page contains remarks on Haskell that I encountered when working with source files that span multiple AoC 2021 problems. and have Haskell solutions. It’ll be nice to compare how they solved the problems. I don’t want to end up perfecting the wrong approach! Setting Up Haskell Env for AoC To manage dependencies, Cabal and Stack are pretty popular. Stack incorporates the Cabal build system.... |