https://github.com/denismurphy/modern-template-techniques
Modern Template Techniques
https://github.com/denismurphy/modern-template-techniques
abstract-class auto class constexpr cpp-templates educational lambda smart-pointers struct template-argument-deduction virtual-function
Last synced: 10 months ago
JSON representation
Modern Template Techniques
- Host: GitHub
- URL: https://github.com/denismurphy/modern-template-techniques
- Owner: denismurphy
- License: mit
- Archived: true
- Created: 2023-01-11T10:53:42.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T17:03:15.000Z (over 1 year ago)
- Last Synced: 2025-04-01T20:06:16.691Z (11 months ago)
- Topics: abstract-class, auto, class, constexpr, cpp-templates, educational, lambda, smart-pointers, struct, template-argument-deduction, virtual-function
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🚀 Modern Template Techniques
This repository explores advanced template techniques in C++, including class template argument deduction, smart pointers, structs, classes, abstract classes, virtual functions, `auto`, `lambda`, and `constexpr`.
🎯 The goal: Personal learning about modern template techniques.
## 📚 Contents
This repo contains various examples illustrating different advanced template techniques and their use cases. Each example is well-commented and easy to understand.
### 🧩 Class Template Argument Deduction
Demonstrates the class template argument deduction feature to deduce template arguments from constructor parameters.
### 🔗 Smart Pointers
Explores using smart pointers to manage the lifetime of objects in class templates and structs.
### 🏗️ Structs and Classes
Shows how structs and classes can be used together in template programming.
### 🎭 Abstract Classes and Virtual Functions
Illustrates the combination of abstract classes and virtual functions in template programming.
### ⚡ Auto and Lambda
Demonstrates how `auto` and lambda can be used with templates to create more concise and expressive code.
### ⏱️ Constexpr
Explores using `constexpr` to make template code more efficient at runtime and during compile-time.
## 📄 License
This repository is licensed under the MIT license.