Last active
May 7, 2020 06:21
-
-
Save peterallin/b0cf901ebdb3b1d47b4f1a2277880318 to your computer and use it in GitHub Desktop.
Template template example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<template<typename, typename> typename T1, typename T2> | |
class Foo | |
{ | |
T1<int, float> t1a; | |
T1<int, int> t1b; | |
T2 t2; | |
}; | |
template<typename T1, typename T2> | |
struct Bar | |
{ | |
T1 t1; | |
T2 t2; | |
}; | |
template<typename T1, typename T2> | |
struct Baz | |
{ | |
T1 t1a; | |
T1 t1b; | |
T2 t2; | |
}; | |
int main() | |
{ | |
Foo<Bar, float> foo1{}; | |
Foo<Baz, float> foo2{}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment