This file contains hidden or 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 Op, typename Tuple, std::size_t... Is> | |
void invoke(Op op, const Tuple& args, std::index_sequence<Is...>) | |
{ | |
op(std::get<Is>(args)...); | |
} | |
template<typename Op, typename... Args> | |
void invoke(Op op, const std::tuple<Args...>& args) | |
{ | |
invoke(op, args, std::index_sequence_for<Args...>{}); |
This file contains hidden or 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 N, typename Tupl, typename Op> | |
struct tuple_transform_impl | |
{ | |
static void increment(Tupl& tuple, Op op) | |
{ | |
std::get<N>(tuple) = op(std::get<N>(tuple)); | |
tuple_transform_impl<N - 1, Tupl, Op>::increment(tuple, op); | |
} | |
}; |
This file contains hidden or 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 <any> | |
#include <cassert> | |
#include <utility> | |
#include <vector> | |
enum class param_type | |
{ | |
templated, | |
normal | |
}; |
This file contains hidden or 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 <cassert> | |
template<typename T> | |
struct types_match | |
{ | |
static bool match() { return false; } | |
}; | |
#define SYNC(cpp_type, type_name) \ | |
template<> \ |
This file contains hidden or 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> | |
template<typename T> | |
struct sample_templated | |
{ | |
T x; | |
int y; | |
}; | |
using instanciated = sample_templated<double>; |
This file contains hidden or 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<unsigned, typename...> | |
struct ntuple_impl; | |
template<unsigned N, typename E, typename... Es> | |
struct ntuple_impl<N, std::enable_if_t<(N > 1)>, E, Es...> | |
{ | |
using type = typename ntuple_impl<N - 1, void, E, E, Es...>::type; | |
}; | |
template<typename... Es> |
This file contains hidden or 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 <tuple> | |
template<unsigned, typename...> | |
struct ntuple_impl; | |
template<unsigned N, typename E, typename... Es> | |
struct ntuple_impl<N, std::enable_if_t<(N > 1)>, E, Es...> | |
{ | |
using type = typename ntuple_impl<N - 1, void, E, E, Es...>::type; |
This file contains hidden or 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
#pragma once | |
#include <Identifiers.hpp> | |
#include <Inputs.hpp> | |
#include <SFML/Graphics/Drawable.hpp> | |
#include <SFML/Graphics/RenderWindow.hpp> | |
#include <SFML/Graphics/Transformable.hpp> | |
#include <SFML/Graphics/View.hpp> | |
#include <SFML/System/Vector2.hpp> | |
#include <Utility.hpp> |
This file contains hidden or 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
const breakpoints = Int[4, 6] | |
const registeredvars = Symbol[] | |
const filename = "testscript.jl" | |
module Exec end | |
function evalandregister(line::String) | |
ast = Meta.parse(line) | |
typeof(ast) == Expr || return | |
if length(ast.args) == 2 && typeof(ast.args[1]) == Symbol |
This file contains hidden or 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 "/usr/include/julia/julia.h" | |
#include <chrono> | |
#include <cstdio> | |
int main() { | |
jl_init(); | |
std::chrono::high_resolution_clock c; | |
jl_eval_string("module Some module Nested module Module function f(a::Int64) " | |
"end end end end"); | |
auto t1 = c.now(); |