|
You are here |
gpfault.net | ||
| | | | |
eyakubovich.github.io
|
|
| | | | | Suppose we need to write a factory function that constructs a runtime polymorphic object. For the purposes of this post, let's say we want to construct a concrete shape object - a rectangle, triangle, or an ellipse. Here are our basic declarations: 1 2 3 4 5 6 7 8... | |
| | | | |
www.fluentcpp.com
|
|
| | | | | Expressive code in C++ | |
| | | | |
entangledlogs.com
|
|
| | | | | Generic Programming: Generating part of programs Introduction Generic Programming: Programming with generic parameters to avoid unnecessary code duplication and encourage code reuse. Polymorphism is also another technique to solve code reuse Puts implicit constraints on the generic types that are to be fulfilled by concrete types. template T adder(T LHS, T RHS) { return LHS + RHS; } struct Foo { inv Val = 0; } Foo f = adder(Foo{}, Foo{}): In this code snippet, we assume that Foo meets the requirement tha... | |
| | | | |
stefan-marr.de
|
|
| | | Lectures on programming language interpreters and just-in-time compilation | ||