ofats / meta_evo Goto Github PK
View Code? Open in Web Editor NEWPresentation materials for C++Siberia 2019 conference
Presentation materials for C++Siberia 2019 conference
main.cpp:82: ошибка: C2593: неоднозначный "operator =="
main.cpp:19: может быть
bool operator ==<int,double,char>(type_pack<int,double,char>,type_pack<int,double,char>)
main.cpp:17: или
bool operator ==<int,double,char,int,double,char>(type_pack<int,double,char>,type_pack<int,double,char>
)
main.cpp:83: при попытке сопоставить список аргументов
(type_pack<int,double,char>, type_pack<int,double,char>)
Я решил так.
template <class... Ts, class... Us, class T = disable_if_t<std::is_same_v<Ts..., Us...>>>
constexpr bool operator==(type_pack<Ts...>, type_pack<Us...>) { return false; }
`
main.cpp:180: ошибка: C2466: невозможно выделить память для массива постоянного нулевого размера
bool bs[]{ std::is_same<T, Ts>::value... };
Моё решение.
namespace good {
// type-based
template <class T, class... Ts>
constexpr bool contains(type_pack<Ts...>)
{
bool res = false;
if constexpr (sizeof...(Ts) > 0)
bool bs[]{ std::is_same<T, Ts>::value... };
for (bool b : bs) {
res |= b;
}
}
return res;
}
...
} // namespace good
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.