Skip to content

Instantly share code, notes, and snippets.

View prapin's full-sized avatar

Patrick Rapin prapin

  • Xample SàRL
  • Villars-sous-Champvent
View GitHub Profile
@prapin
prapin / typesafe_varargs.cpp
Last active November 22, 2018 15:49 — forked from Aszarsha/typesafe_varargs.cpp
A simpler version that decreases the overhead of the variadic call.
// Type-safe varargs with C++11 variadic templates.
//
// Andreas Fredriksson <deplinenoise at gmail dott com>
// minor changes from:
// Thomas Hume <thomas dot hume at labri dot fr>
// modified by Patrick Rapin
//
// This code is in the public domain.
#include <stdio.h>
@prapin
prapin / destructors_reporter.pl
Created July 1, 2014 20:26
Perl script to find destructors of all classes in a C++ directory and to report their visibility
#!/usr/bin/perl
use File::Find;
use strict;
# Perl script to find destructors of all classes in a C++ directory,
# and to report their visibility.
# Usage: run the script without argument in the source root directory.
# The script will find all .cpp, .h and .mm files in the file hierarchy.
# For each class or struct found, it displays 4 fields separated with tabulations:
# - the class name (can be an inner class)
@prapin
prapin / DataDumper.lua
Created January 5, 2011 16:11
DataDumper is a Lua table serialization, slow but mostly complete
--[[ DataDumper.lua
Copyright (c) 2007 Olivetti-Engineering SA
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following