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> | |
int foo() { return 123; } | |
int bar() { foo(); } | |
int main() | |
{ | |
std::cout << bar() << std::endl; | |
} |
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 <type_traits> | |
template <auto *V> | |
struct floating_point_constant { | |
static constexpr auto value = *V; | |
static_assert(std::is_floating_point_v<decltype(value)>); | |
using value_type = decltype(value); |
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> | |
#include <vector> | |
#include <unordered_map> | |
#include <string> | |
#include <cassert> | |
#include <functional> | |
#include <typeinfo> | |
#include <deque> |
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 <variant> | |
#include <any> | |
#include <string> | |
#include <type_traits> | |
#include <functional> | |
#include <limits> | |
#include <unordered_map> | |
#include <stack> |
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
local maid64 = require 'maid64' | |
function resize(width, height) | |
local w, h = love.graphics.getDimensions() | |
width = math.max(maid64.sizeX, math.floor((width or w) / maid64.sizeX) * maid64.sizeX) | |
height = math.max(maid64.sizeY, math.floor((height or h) / maid64.sizeY) * maid64.sizeY) | |
maid64.resize(width, height) | |
if maid64.overscan then | |
maid64.x = (w - (maid64.scaler * maid64.sizeX)) / 2 | |
else |
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
-- https://stackoverflow.com/questions/33988610/weird-behavior-of-syntax-sugarcolon-in-lua | |
local debug = require 'debug' | |
debug.setmetatable(0, { __index = math }) | |
debug.setmetatable(function() end, { __index = coroutine }) | |
debug.setmetatable(coroutine.create(function() end), { __index = coroutine }) | |
local table = require 'table' | |
table.new = function (self, t) | |
t = t or self |
OlderNewer