Skip to content

Instantly share code, notes, and snippets.

Avatar

Karim Ahmed kariem2k

View GitHub Profile
@ErikAugust
ErikAugust / spectre.c
Last active Jul 23, 2020
Spectre example code
View spectre.c
#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
View orthodoxc++.md

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++?

@kennytm
kennytm / test.cpp
Created Nov 30, 2012
Substituting template arguments in the clang C++ library
View test.cpp
#include <type_traits>
#include <cstdio>
namespace L {
template <int n>
struct N {
static constexpr bool equals(int m) { return m == n; }
};
@rmartinho
rmartinho / hate.markdown
Last active Jul 15, 2020
I will hate you
View hate.markdown

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.

You can’t perform that action at this time.