Skip to content

Instantly share code, notes, and snippets.

@NicolBolas
NicolBolas / test.lua
Created May 20, 2019 15:11
Lua precompiled concatenation test
local chunk1 = [[
foo = 12
]]
local chunk2 = [[
foo = 0
]]
chunk1 = loadstring(chunk1)
chunk2 = loadstring(chunk2)
@NicolBolas
NicolBolas / split_regex
Created December 30, 2016 17:06
C++ regex-based string splitter
template<typename CharT, typename Traits = std::char_traits<CharT>>
class split_range_regex
{
public:
using value_type = std::basic_string_view<CharT, Traits>;
using traits_type = Traits;
using size_type = typename value_type::size_type;
using difference_type = typename value_type::difference_type;
using reference = value_type;
using const_reference = reference;
# Macro for setting up precompiled headers. Usage:
#
# add_precompiled_header(target header.h [FORCEINCLUDE])
#
# MSVC: A source file with the same name as the header must exist and
# be included in the target (E.g. header.cpp).
#
# MSVC: Add FORCEINCLUDE to automatically include the precompiled
# header file from every source file.
#