-
Notifications
You must be signed in to change notification settings - Fork 73
/
template_params.cxx
45 lines (41 loc) · 1.48 KB
/
template_params.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#feature on interface
#include <iostream>
#include <concepts>
#include <vector>
template<
auto nontype,
typename type,
template<...> typename type_template,
template<...> auto var_template,
template<...> concept concept_,
interface interface_,
template<...> interface interface_template,
namespace namespace_,
template auto universal
> void f() {
std::cout<< "nontype = {}\n".format(nontype~string);
std::cout<< "type = {}\n".format(type~string);
std::cout<< "type_template = {}\n".format(type_template~string);
std::cout<< "var_template = {}\n".format(var_template~string);
std::cout<< "concept = {}\n".format(concept_~string);
std::cout<< "interface = {}\n".format(interface_~string);
std::cout<< "interface_template = {}\n".format(interface_template~string);
std::cout<< "namespace = {}\n".format(namespace_~string);
std::cout<< "universal = {}\n".format(universal~string);
}
interface IPrint { };
template<interface IBase>
interface IClone : IBase { };
int main() {
f<
5, // non-type
char[3], // type
std::basic_string, // type template
std::is_signed_v, // variable template
std::integral, // concept
IPrint, // interface
IClone, // interface template
std, // namespace
void // universal
>();
}