Skip to content

Instantly share code, notes, and snippets.

View kariem2k's full-sized avatar

Karim Ahmed kariem2k

View GitHub Profile
@rmartinho
rmartinho / hate.markdown
Last active July 15, 2020 01:33
I will hate you

Dear C++ library writer,

  1. If your library forces me to use new all over, I will hate you.

  2. If your library has types with bogus values, I will hate you.

  3. If the documentation for your library gets the terminology of its own domain wrong, I will hate you.

  4. If I say "My God, it's full of stars!" when I see the function signatures in your library, I will hate you.

@kennytm
kennytm / test.cpp
Created November 30, 2012 20:49
Substituting template arguments in the clang C++ library
#include <type_traits>
#include <cstdio>
namespace L {
template <int n>
struct N {
static constexpr bool equals(int m) { return m == n; }
};
@bkaradzic
bkaradzic / orthodoxc++.md
Last active April 14, 2024 00:25
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif