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
#!/usr/bin/env bash | |
# BASH error handling: | |
# if you run this script with 'set -x' the below line will remove all trap's line from the trace | |
exec 2> >(grep -E -v '\+\+ (CURRENT_COMMAND|LAST_COMMAND|ERROR_CODE=|FAILED_COMMAND=|tput setaf 1|tput sgr0)' >&2) | |
# exit on command failure | |
set -e | |
# keep track of the last executed command | |
trap 'LAST_COMMAND=$CURRENT_COMMAND; CURRENT_COMMAND=$BASH_COMMAND' DEBUG | |
# on error: print the failed command |
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
# ~~~ | |
# Make the generated files depend on the grammer files | |
# PROBLEM: CMake is difficult in depending on generated files which are | |
# unknown in configure time. the antlr4 generated files (names and count) depend on the | |
# parameters & the files it is invoked with. | |
# SOLUTION: generate once, so we know exactly which files are generated. | |
# then, we depend on these files with add_custom_target() | |
# ~~~ | |
message( | |
STATUS "Antlr4: generating parser for grammer '${ARG_NAME}' - first time") |
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
// This file was initially generated by Windows Terminal Preview 1.1.1812.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", | |
// You can add more global application settings here. |
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
git filter-branch --tree-filter 'clang-format -i $(\ | |
git show $GIT_COMMIT --name-status | egrep ^[AM] |\ | |
grep -e .cpp -e .h | cut -f2)' -- --all |
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 <memory> | |
#include <cstdio> | |
template<typename F> | |
class defer_finalizer { | |
F f; | |
bool moved = false; | |
public: | |
template<typename T> | |
defer_finalizer(T && f_) : f(std::forward<T>(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
<?xml version="1.0" encoding="utf-8"?> | |
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> | |
<!-- VC 2015 --> | |
<Type Name="std::_Compressed_pair<*,*,1>"> | |
<DisplayString>{*($T1 *)this}</DisplayString> | |
<Expand> | |
<ExpandedItem>*($T1 *)this</ExpandedItem> | |
</Expand> | |
</Type> |
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
#pragma once | |
template <typename T> | |
struct NonConst | |
{ | |
typedef T type; | |
}; | |
template <typename T> | |
struct NonConst<T const> | |
{ |