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> | |
#include <functional> | |
template <typename F, typename T> | |
struct case_impl : F { | |
using IS_CASE_IMPL_FOR = T; | |
using F::operator(); | |
constexpr case_impl(F f) : 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
#include <optional> | |
#include <utility> | |
#include <type_traits> | |
#include <tuple> | |
// C++ compile time parser (without using constexpr strings) | |
// PARSER DEFINITION | |
#define PARSER(...) template <__VA_ARGS__ __VA_OPT__(,) unsigned N, const char Str[N], unsigned Pos> |
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> | |
#include <tuple> | |
#include <iostream> | |
#include <string> | |
namespace lambda_term { | |
struct TermBase {}; | |
template <typename T> | |
concept Term = std::is_base_of_v<TermBase, 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 <utility> | |
#include <tuple> | |
#include <boost/preprocessor/repetition/repeat.hpp> | |
#include <boost/preprocessor/punctuation/comma_if.hpp> | |
#include <boost/preprocessor/control/if.hpp> | |
#define BINDERS_LIMIT 256 // Number of binders must be less than BINDERS_LIMIT | |
template <typename... Ts> struct overloads : Ts... { using Ts::operator()...; }; | |
template <typename... Ts> overloads(Ts...) -> overloads<Ts...>; |
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> | |
#include <utility> | |
namespace detail { | |
template <typename T, typename U> | |
constexpr bool linear_usable_as_v = | |
std::is_nothrow_constructible_v<T, U> && | |
std::is_nothrow_assignable_v<T&, U> && | |
std::is_nothrow_convertible_v<U, 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
cmake_minimum_required (VERSION 3.8) | |
project(split_into_circles) | |
set(CMAKE_CXX_STANDARD 17) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -pedantic -DTEST") | |
add_executable(run_test split_into_circles.cpp) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 <vector> | |
#include <algorithm> | |
#include <cassert> | |
using dist_2_t = uint64_t; | |
using point = std::pair<int, int>; | |
dist_2_t get_dist_2(const point &p1, const point &p2) { | |
dist_2_t dx = p1.first - p2.first; |
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
#define _USE_MATH_DEFINES | |
#include <math.h> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <tuple> | |
#include <algorithm> | |
#include <unordered_map> | |
#include <functional> | |
#include <ctime> |