This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<type_traits> | |
template<class T> | |
struct S | |
{ | |
template <class F, typename std::enable_if< | |
std::is_void<decltype(std::declval<F>()(std::declval<T>()))>::value | |
>::type* = nullptr> | |
void then(F f) | |
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace msglike | |
{ | |
using Val = s3d::JSONValue; | |
namespace develop | |
{ | |
class stop {};//そこまでよ!!! | |
class none {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace alol{ | |
template<class...T> | |
class ordered_poly_lambda | |
{ | |
struct stop{}; | |
public: | |
void operator()(stop){} | |
}; | |
template<class F, class ...T> | |
class ordered_poly_lambda<F, T...> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace alol{ | |
template<class...T> | |
class poly_lambda | |
{ | |
struct stop{}; | |
public: | |
void operator()(stop){} | |
}; | |
template<class F, class ...T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace alol{ | |
template<class...T> | |
class poly_lambda | |
{ | |
struct hoge{}; | |
public: | |
void operator()(hoge){} | |
}; | |
template<class F, class ...T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include"alol.h" | |
struct F | |
{ | |
template<class T> | |
int operator()(T&&) | |
{ | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<sprout/array.hpp> | |
#include<iostream> | |
#include<utility> | |
template<char...c> | |
struct String{ | |
constexpr auto operator[](std::size_t n)const{ | |
char s[]={c...,'\0'}; | |
return s[n]; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<int>struct Int{}; | |
template<int N> | |
struct flag { | |
friend constexpr int adl_flag (flag<N>); | |
}; | |
// NOTICE noexcept(adl_flag (flag<N> {}))を用いた実装はClangで動かないからこの実装になった | |
template<int N, int = adl_flag (flag<N> {})> | |
constexpr bool c_ (int, flag<N>) {return true;} | |
template<int N> | |
constexpr bool c_ (float, flag<N>) {return false;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<type_traits> | |
template<class> | |
struct wrap{}; | |
template<std::size_t N, class T, class ...R> | |
struct A | |
:A<N + 1, R...> | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<array> | |
template<class T, std::size_t N> | |
class Polynomial | |
{ | |
std::array<T, N + 1> data; | |
using value_type = T; | |
public: | |
template<class T,class ...U> | |
Polynomial(T x, U ...y) |