- 🌏 The official ISO C++ Get Started! page
- 🎥 Herb Sutter: (Not Your Father’s) C++
- 🎥 Beginning with C++ by Jens Weller
#include <vector> | |
#include <iostream> | |
#include <numeric> | |
#include <string> | |
#include <optional> | |
void printStringLine(std::string s) | |
{ | |
std::cout << s << '\n'; | |
} |
// https://playfulprogramming.blogspot.com/2016/12/serializing-structs-with-c17-structured.html | |
// https://codereview.stackexchange.com/questions/142804/get-n-th-data-member-of-a-struct | |
// https://stackoverflow.com/questions/39768517/structured-bindings-width | |
// https://stackoverflow.com/questions/35463646/arity-of-aggregate-in-logarithmic-time | |
// https://stackoverflow.com/questions/38393302/returning-variadic-aggregates-struct-and-syntax-for-c17-variadic-template-c | |
#pragma once | |
#include <type_traits> |
// bitset_iter.h v1.1.0 | |
// Copyright 2019, Diego Dagum | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
// Be sure to set your project to use the ISO C++17 Standard (/std:c++17) under | |
// C++ Language Standard in Properties... C/C++... Language... | |
#include <string> | |
#include <iostream> | |
#include <algorithm> | |
#include <execution> | |
#include <random> | |
#include <chrono> | |
#include <iomanip> |
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
if [ $# -gt 1 ] | |
then | |
echo "Checking out LLVM '$1' branch from svn into '`pwd`/llvm' and setting install prefix to '$2'" | |
echo "Press Return To Continue" | |
read $VAR | |
else | |
echo "Usage: $0 <branch name> <install prefix>" | |
exit | |
fi |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
#!/usr/bin/env bash | |
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\ | |
function register_clang_version { | |
local version=$1 | |
local priority=$2 | |
update-alternatives \ | |
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \ |