Skip to content

Instantly share code, notes, and snippets.

View foolnotion's full-sized avatar

Bogdan Burlacu foolnotion

View GitHub Profile
template<typename InputIt, typename Projection>
struct ProjectionIterator {
using T = typename std::iterator_traits<InputIt>::value_type;
using R = std::result_of_t<Projection(T)>;
// projection iterator traits
using value_type = std::remove_reference_t<R>;
using pointer = void;
using reference = value_type&;
using difference_type = typename std::iterator_traits<InputIt>::difference_type;
# This file is part of EAP.
#
# EAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# EAP is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@foolnotion
foolnotion / jsf.hpp
Created October 25, 2018 20:45 — forked from imneme/jsf.hpp
A C++ Implementation of Bob Jenkins's Small Fast Noncryptographic PRNG (JSF)
#ifndef JSF_HPP_INCLUDED
#define JSF_HPP_INCLUDED 1
/*
* A C++ implementation of a Bob Jenkins Small Fast (Noncryptographic) PRNGs
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Melissa E. O'Neill
*
@foolnotion
foolnotion / random.h
Created October 25, 2018 19:58 — forked from Leandros/random.h
C++ Pseudo Random Number Generators
/* Copyright (c) 2018 Arvid Gerstmann. */
/* This code is licensed under MIT license. */
#ifndef AG_RANDOM_H
#define AG_RANDOM_H
class splitmix
{
public:
using result_type = uint32_t;
static constexpr result_type (min)() { return 0; }