Konard / CppCLIGenericsExample

Generating multiple implementations of a generic interface using C++/CLI template and .NET Framework 4.7.2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CppCLIGenericsExample

This example shows how to generate multiple generic interface implementations using C++/CLI template. There is the IGeneric<T> interface. C++/CLI template is used to generate specific implementations of this interface for UInt64, UInt32, UInt16 and Byte types. All implementations share single base template ClassTemplate logic.

The problem with current approach is that it works only for Windows while support for C++/CLI is not crossplatform.

It is possible to achieve the same result using C#, T4 text template and .NET Core 2.2.

Prerequisites

Run

  • Clone repository
  • Open solution (.sln file) in Visual Studio
  • Press F5 to build and start program

Development process videos

https://youtu.be/MSjBlWnINQQ

About

Generating multiple implementations of a generic interface using C++/CLI template and .NET Framework 4.7.2

License:MIT License


Languages

Language:C++ 77.6%Language:C 22.4%