An open API service indexing awesome lists of open source software.

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

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.