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
// This is used to check if native JavaScript methods are overridden by a third-party source | |
function checkObject() { | |
['assign', 'create', 'defineProperty', 'defineProperties', 'entries', 'freeze', | |
'getOwnPropertyDescriptor', 'getOwnPropertyNames', 'getOwnPropertySymbols', | |
'getPrototypeOf', 'is', 'isExtensible', 'isFrozen', 'isSealed', 'keys', | |
'preventExtensions', 'seal', 'setPrototypeOf', 'values'].forEach(method => { | |
if (!Object[method]) { | |
console.warn(`Object.${method} method is missing.`); | |
} else if (Object[method].toString() !== `function ${method}() { [native code] }`) { // For Safari, the code is `function ${method}() {\n [native code]\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
#ifndef RECURSIVE_recursive_generator | |
#define RECURSIVE_recursive_generator | |
#include <experimental/coroutine> | |
// This class implements delegating (potentially recursive) recursive_generator. | |
// It supports two kind of yield expressions: | |
// | |
// co_yield V; | |
// co_yield G_of_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 <tuple> | |
#include <type_traits> | |
#include <cassert> | |
template <class T, class... TArgs> decltype(void(T{std::declval<TArgs>()...}), std::true_type{}) test_is_braces_constructible(int); | |
template <class, class...> std::false_type test_is_braces_constructible(...); | |
template <class T, class... TArgs> using is_braces_constructible = decltype(test_is_braces_constructible<T, TArgs...>(0)); | |
struct any_type { | |
template<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
template <typename Left, typename Right> | |
struct ConcatExpr; | |
template <typename Left, typename Right> | |
struct AltExpr; | |
template <typename SubExpr> | |
struct RepeatExpr; | |
template <char ch> |