cpp-programming

Simple C++ programs
git clone git://git.laack.co/cpp-programming.git
Log | Files | Refs | README

commit ed6d8cd0e9ec043f252235e9365b96383bcbf9e7
parent f55b327f0322fd148dd7b971bd6c3418067ec112
Author: Andrew Laack <andrew@laack.co>
Date:   Tue, 25 Aug 2026 22:31:48 -0500

Use aliasing (with _using_) when necessary / possible

Diffstat:
Amodern-cpp-cookbook/ch1/alias/alias.cpp | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/modern-cpp-cookbook/ch1/alias/alias.cpp b/modern-cpp-cookbook/ch1/alias/alias.cpp @@ -0,0 +1,17 @@ +#include <iostream> +#include <string> + + +void printHello(std::string name, uint age) { + std::cout << "hello " << name << ", " << age << std::endl; + return; +} + +int main() { + // could also use auto... + using fn = void(std::string, uint); + fn* prnt = printHello; + + prnt("Andrew", 200); + return 0; +}