Instantly share code, notes, and snippets.

View nanomsg_multipart.cc
#include <nanomsg/nn.h>
#include <nanomsg/reqrep.h>
#include <string>
#include <cstring>
#include <cstdio>
#include <iostream>
#include <vector>
#include <memory>
#include <limits>
View limbes.cc
#include <iostream>
#include <vector>
#include <stdexcept>
#include <cassert>
#include <limits>
#include <algorithm>
class Cell {
public:
friend class Angel;
View list.c
#include "list.h"
#include <stdlib.h>
static bool list_empty(struct list *this)
{
return this == NULL ? TRUE :
this->m_size == 0 ? TRUE : FALSE;
}
View optional.h
#ifndef OPTION_H
#define OPTION_H
#include <cstdlib>
#include <cstring>
#include <utility>
#include <iostream>
#include <tuple>
#include <functional>
View string.c
#include "string.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h> /* DEBUG */
static string_err string_enlarge(String *this, size_t add)
{
string_err err = STRING_ERR_OK;
View sitemap_crawl.cc
#include "Poco/DOM/DOMParser.h"
#include "Poco/DOM/Document.h"
#include "Poco/DOM/AutoPtr.h"
#include "Poco/SAX/InputSource.h"
#include "Poco/Net/HTTPClientSession.h"
#include "Poco/Net/HTTPRequest.h"
#include "Poco/Net/HTTPResponse.h"
#include "Poco/Net/DNS.h"
#include "Poco/DOM/ElementsByTagNameList.h"
#include <set>
View article-cpp-vartemplates.md

Title: Jouons avec C++11: métaprogrammation et variadic templates Date: 2013-05-19 12:26:00 Tags: c++, c++11, templates, variadic templates, metaprogrammation Author: Mathieu Stefani

Aujourd'hui nous allons nous détendre avec un peu de C++, mais pas n'importe quel C++ ! Nous allons faire du C++11 et nous allons explorer ensemble une fonctionnalité très intéressante et aux nombreuses possibilités du langage : les variadic templates.

View compile-time-crc32.cc
constexpr unsigned int crc32_table[] = {
0, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
View binary-converter.cc
#include <iostream>
#include <type_traits>
#include <cassert>
namespace details {
template<typename T> struct DigitValue {
};
template<> struct DigitValue<int> {
static constexpr int v(const int value) { return value; }
View binary-converter.cc
#include <iostream>
#include <type_traits>
#include <cassert>
namespace details {
template<typename T> struct DigitValue {
};
template<> struct DigitValue<int> {
static constexpr int v(const int value) { return value; }