-
Notifications
You must be signed in to change notification settings - Fork 0
/
universal.cpp
54 lines (44 loc) · 815 Bytes
/
universal.cpp
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
46
47
48
49
50
51
52
53
54
// ideas from the unviersal template parameters paper
#include<iostream> // std::cout
template<template<typename T> typename Args>
struct xyz
{
using value = Args<int>;
};
template<typename T>
struct x
{
using value = T;
};
template<auto N, auto B>
struct universal
{
static constexpr decltype(N) a = N;
static constexpr decltype(B) b = B;
};
namespace traits
{
template<typename T, typename B>
constexpr bool is_same = false;
template<typename T>
constexpr bool is_same<T, T> = true;
}
struct A
{
int data_member{};
};
struct B
{
double data_member{};
};
//int main()
//{
A a{};
B b{};
std::cout << traits::is_same<A, B>;
x<int> X{};
// xyz<x>;
//}
//template<template <template auto...> typename F, template auto... Args>
struct s{
};