/
UCS
/
sqlite_orm
Обзор
Документация
Войти
/
UCS
/
sqlite_orm
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
dev/tuple_helper/same_or_void.h
28 строк
641 B
klaus triendl
Simplified `same_or_void` metafunction
19 мар 2022, 00:23
19 мар 2022, 00:23
2f425fc
Код
Авторство
О чём код?
#pragma once namespace sqlite_orm { namespace internal { /** * Accepts any number of arguments and evaluates `type` alias as T if all arguments are the same or void otherwise */ template<class... Args> struct same_or_void { using type = void; }; template<class A> struct same_or_void<A> { using type = A; }; template<class A> struct same_or_void<A, A> { using type = A; }; template<class A, class... Args> struct same_or_void<A, A, Args...> : same_or_void<A, Args...> {}; } }