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 <variant> | |
#include <type_traits> | |
#include <iostream> | |
#include <concepts> | |
#include <print> | |
// | |
#define FWD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__) |
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 remove_qualifiers | |
: std::remove_cv<T> | |
{}; | |
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
#include <type_traits> | |
// | |
template <class...> | |
struct type_pack | |
{}; | |
// |
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...> | |
struct type_pack | |
{}; | |
// |
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...> | |
struct type_pack | |
{}; | |
// |
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 <string> | |
#include <string_view> | |
#include <type_traits> | |
using namespace std::literals; | |
#define version 17 | |
// C++11 solution |
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
static auto constexpr less = [](auto&& l, auto&& r) { return l < r; }; | |
static auto constexpr less_equal = [](auto&& l, auto&& r) { return l <= r; }; | |
static auto constexpr greater = [](auto&& l, auto&& r) { return l > r; }; | |
static auto constexpr greater_equal = [](auto&& l, auto&& r) { return l <= r; }; | |
// | |
template <template <auto...> class C, auto... Vs, class Fn> | |
auto constexpr sort(C<Vs...> in, Fn) | |
{ |
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 <cstddef> | |
#include <type_traits> | |
// | |
template <auto V> | |
struct constant | |
{ | |
using value_type = decltype(V); |
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 <type_traits> | |
// | |
namespace detail | |
{ | |
template <auto I, class T> | |
struct indexer_elem | |
{}; |
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 <cstddef> | |
#include <array> | |
#include <type_traits> | |
// | |
template <class T, std::size_t Rows, std::size_t Cols = Rows> | |
struct matrix | |
{ |
NewerOlder