Skip to content

Instantly share code, notes, and snippets.

View lefticus's full-sized avatar

Jason Turner lefticus

View GitHub Profile
@lefticus
lefticus / constexpr_maze.cpp
Last active September 2, 2024 22:22
Compile-time maze generator and solver
//https://gcc.godbolt.org/z/84hhzGoa4
#include <cstdint>
#include <cstddef>
#include <limits>
#include <utility>
#include <iostream>
#include <string>
constexpr auto seed()
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the

A View to a Thing

Jason Turner

  • Host of C++ Weekly
  • Co-host of CppCast
  • Speaker / Contractor / Trainer
git clone git://gcc.gnu.org/git/gcc.git
mkdir gcc_build
cd gcc_build
../gcc/configure --disable-bootstrap --disable-werror --disable-multilib --enable-languages=c,c++ --prefix=/usr/local
make -j3
make install
@lefticus
lefticus / get_llvm.sh
Last active August 22, 2023 22:58
A script for building LLVM
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
#include <vector>
int main()
{
// initialize a vector of integers. For the purposes of this example let's assume we *need* a vector
std::vector<int> v {1, 2, 3, 4, 5, 6, 1012, 1094};
}
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
template<typename ... T>
std::vector<std::string> to_strings(const T& ... t)
{
std::stringstream ss;
return { (ss.str(""), ss << t, ss.str())... };
#include <iostream>
#include <memory>
#include <vector>
#include <algorithm>
#include <type_traits>
template< class ... > using void_t = void;
template< class T , class = void >
struct is_dereferenceable : std::false_type
repositories:
- "ChaiScript/ChaiScript"