Skip to content

Instantly share code, notes, and snippets.

View NotAPenguin0's full-sized avatar
🐧
Not on vacation.

NotAPenguin NotAPenguin0

🐧
Not on vacation.
View GitHub Profile
#ifndef HEALTHBAR_HPP
#define HEALTHBAR_HPP
#include "observer.hpp"
#include <iostream>
class healthbar : public observer
{
public:
virtual ~healthbar() = default;
#ifndef MVG_MULTI_ITERATOR_HPP_
#define MVG_MULTI_ITERATOR_HPP_
#include <tuple>
#include <algorithm>
#include <iterator> //To specialize std::iterator_traits<T>
#include <cstddef> //For std::size_t
#include <type_traits>
#include <cassert>
#include <utility>
@NotAPenguin0
NotAPenguin0 / string.hpp
Created October 30, 2018 11:41
string.hpp
#pragma once
#include "def.hpp"
#include "utility.hpp"
#ifndef UNREAL_BUILD
#include <iostream>
#endif
namespace bbstl
@NotAPenguin0
NotAPenguin0 / string.hpp
Created November 1, 2018 11:19
bbstl::string
#pragma once
#include "def.hpp"
#include "utility.hpp"
#include "exception.hpp"
#ifndef UNREAL_BUILD
#include <iostream>
#endif
@NotAPenguin0
NotAPenguin0 / string.hpp
Created November 2, 2018 19:19
bbstl string
#pragma once
#include "def.hpp"
#include "utility.hpp"
#include "exception.hpp"
#ifndef UNREAL_BUILD
#include <iostream>
#endif
@NotAPenguin0
NotAPenguin0 / argpack_util.hpp
Last active November 12, 2018 20:27
type_list.hpp
#ifndef MVG_ARGPACK_UTILITY_HPP_
#define MVG_ARGPACK_UTILITY_HPP_
#include <cstddef> //std::size_t
namespace mvg
{
namespace detail
{
#ifndef MVG_TYPE_LIST_HPP_
#define MVG_TYPE_LIST_HPP_
#include <tuple>
#include "argpack_util.hpp"
namespace mvg
{
template<typename...Ts>
namespace detail
{
template<std::size_t I, template<typename> typename Pred, typename TList, typename Res>
struct filter_if_impl;
/*
*Message to future me:
*10 minutes after writing this, I don't understand how it works anymore
*Please don't try
**/
@NotAPenguin0
NotAPenguin0 / filter_if.hpp
Created November 14, 2018 20:50
Weird filter thing
namespace detail
{
template<std::size_t I, template<typename> typename Pred, typename TList, typename Res>
struct filter_if_impl;
template<template<typename> typename Pred, typename... Ts, typename... Res>
struct filter_if_impl<1, Pred, type_list<Ts...>, type_list<Res...>>
//specialization for last element to end recursion (or fist, whatever, we are iterating backwards here)
{
using T = typename type_list<Ts...>::template at<type_list<Ts...>::size - 1>;
@NotAPenguin0
NotAPenguin0 / metafunc.hpp
Created November 14, 2018 21:13
metafunc utility
template<template<typename> typename F>
struct bool_metafunc
{
template<typename T>
struct negate
{
static constexpr bool value = !(F<T>::value);
};
template<template<typename> typename Other>