Skip to content

Instantly share code, notes, and snippets.

View simmplecoder's full-sized avatar

Olzhas Zhumabek simmplecoder

View GitHub Profile
#ifndef PRIME_NUMBERS_H
#define PRIME_NUMBERS_H
#include <vector>
#include <algorithm>
template <typename NumberType>
/*
NumberType requires:
Construction from unsigned int;
template <typename Engine = std::mt19937>
class random_bits_generator
{
Engine engine;
std::bernoulli_distribution distribution;
public:
template <typename OutputIt>
void operator()(OutputIt first, OutputIt last)
{
while (first != last)
#pragma once
#include <chrono>
#include <utility>
template <class Func, class ... Args>
std::chrono::duration<double> measure(Func function, Args&& ... args)
{
auto start = std::chrono::high_resolution_clock::now();
function(std::forward<Args>(args)...);