Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- #include <string>
- #include <thread>
- #include <mutex>
- template <typename ...Arg>
- concept is_fucking_string = (std::is_convertible_v<Arg, std::string> && ...);
- template <typename T,typename...Pack>
- concept is_same = requires(T t,Pack...pk)
- {
- requires(std::is_same_v<T, Pack> && ...);
- };
- template <typename T,typename ...Arg>
- concept mixin = is_fucking_string<Arg...> && is_same<T,Arg...>;
- template <typename T,typename ...Arg>
- decltype(auto) foo(T t,Arg...arg) requires mixin<T,Arg...>
- {
- return (std::string(t) + ... + std::string(arg));
- }
- template <typename T,typename ...Arg>
- decltype(auto) foo(T t,Arg...arg) requires is_same<T,Arg...>
- {
- return (arg + ...);
- }
- int main()
- {
- std::cout << foo("33","gg");
- }
Advertisement
Add Comment
Please, Sign In to add comment