Skip to content

Instantly share code, notes, and snippets.

namespace Internal
{
template<typename T> struct IsContainerHelper
{
template<typename U,
typename Require1 = decltype(std::begin(std::declval<const U&>())),
typename Require2 = decltype(std::end(std::declval<const U&>()))>
static std::true_type test(const U*);
template<typename U> static std::false_type test(...);
@vittorioromeo
vittorioromeo / VirtualMachine.cpp
Last active December 31, 2015 20:29
Simple virtual machine created for fun (now with WIP function magic)
namespace ssvvm
{
class Value
{
public:
enum class Type{Null, Int, Float};
private:
Type type{Type::Null};
union { int implInt; float implFloat; };
@vittorioromeo
vittorioromeo / veeAsmTest1
Last active December 31, 2015 22:39
veeasm test
//!ssvasm
$require_registers(3);
$define(R0, 0);
$define(R1, 1);
$define(ROutput, 2);
@vittorioromeo
vittorioromeo / veeAsmFibonacci
Created December 20, 2013 14:50
Fibonacci in veeAsm
//!ssvasm
$require_registers(4);
$define(R0, 0);
$define(R1, 1);
$define(R2, 2);
$define(ROutput, 3);
#include <list>
#include <SSVUtils/SSVUtils.hpp>
volatile bool state {false};
struct TestClass
{
volatile int k{0};
volatile int y{0};
volatile bool todel{false};
template<typename T> class AABBImpl
{
public:
using VecT = Vec2<T>;
private:
VecT position, halfSize;
public:
struct TagFromPosition { };
#!/bin/bash
clang++ "$@" -Wall -Wextra -Wpedantic -Wshadow -Wheader-hygiene -Wcast-align -Wconversion \
-Wmissing-declarations -Wunreachable-code
#!/bin/bash
gcc $1 -o /tmp/$1 && /tmp/$1
@vittorioromeo
vittorioromeo / parsingTests.cpp
Created January 13, 2014 15:31
parsing tests
#include <iostream>
#include <SSVUtils/SSVUtils.hpp>
enum class Token
{
Num,
POpen,
PClose,
OpAdd,
OpSub
@vittorioromeo
vittorioromeo / mplTests.hpp
Created January 17, 2014 17:00
MPL tests
#include <SSVUtils/SSVUtils.hpp>
namespace ssvu
{
namespace MPL
{
template<typename...> struct List;
namespace Internal
{