Skip to content

Instantly share code, notes, and snippets.

View gnzlbg's full-sized avatar

gnzlbg gnzlbg

View GitHub Profile
@gnzlbg
gnzlbg / gist:db97be19ea35d025db1f
Created July 11, 2014 11:09
ranges::make for range-v3
////////////////////////////////////////////////////////////////////////////////
///
/// \file A make function for the range-v3 library that is able to construct
/// a range from:
/// - a pair of indices
/// - an index and a predicate
/// - a pair of iterators
/// - an iterator and a size
/// - an iterator and a predicate
/// - a container (not implemented yet since we can just use as_range)
@gnzlbg
gnzlbg / gist:435e63a781f387fcb8aa
Created October 10, 2014 13:53
Constexpr storage class
/// Stack storage implementation
/// - preconditions: NoRows != dynamic && NoCols != dynamic
template<class T, template <class> class StorageContainer,
TInt NoRows, TInt NoCols, TInt MaxRows, TInt MaxCols>
struct storage<T, StorageContainer, NoRows, NoCols, MaxRows, MaxCols, stack_storage> {
static_assert(NoRows != dynamic, "stack storage with dynamic #of rows");
static_assert(NoCols != dynamic, "stack storage with dynamic #of columns");
static constexpr auto max_no_rows() RETURNS(MaxRows);
static constexpr auto max_no_cols() RETURNS(MaxCols);
@gnzlbg
gnzlbg / gist:7714403baeef9bcd4be9
Created December 12, 2014 14:04
arithmetic type
#pragma once
/// \file arithmetic.hpp Arithmetic type without implicit conversions
#include <type_traits>
#include <limits>
#include <algorithm>
/// Arithmetic type without implicit conversions
template <class T, class B = void> struct arithmetic {
using value_type = T;
// using difference_type = arithmetic<T, B>;
@gnzlbg
gnzlbg / gist:dcd7f2d7408e763bd416
Created February 18, 2015 15:13
Any-type with over-alignment
#pragma once
/// \file any.hpp Any
///
/// (C) Copyright Christopher Diggins 2005-2011
/// (C) Copyright Pablo Aguilar 2005
/// (C) Copyright Kevlin Henney 2001
///
/// Distributed under the Boost Software License, Version 1.0. (See
/// accompanying file LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt
@gnzlbg
gnzlbg / gist:c97742bb08cb6568b8bd
Created May 12, 2015 10:37
clang-format layer
;;; packages.el --- clang-format Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
@gnzlbg
gnzlbg / alt_gist_issue_16231.sh
Created December 3, 2012 16:25
homebrew alternative gist to Issue #16231
//////////////////////////////////////////////////////////////////////
Issue #16231
brew install -v wget
brew doctor
brew config
//////////////////////////////////////////////////////////////////////
@gnzlbg
gnzlbg / boost_ompi_fail
Created December 3, 2012 17:45
Open mpi fails to build when boost is installed - Homebrew
Issue #16374
///////////////////////////////////////////////////////////
doctor:
brew doctor
Your system is raring to brew.
///////////////////////////////////////////////////////////
@gnzlbg
gnzlbg / my_brew_config
Created December 12, 2012 17:22
homebrew issue #16492
HOMEBREW_VERSION: 0.9.3
HEAD: 2b6b8a7abc0c38291234a6728c31fbd830e71d9d
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.8.2-x86_64
Xcode: 4.5.2
CLT: 4.5.0.0.1.1249367152
GCC-4.2: build 5666
LLVM-GCC: build 2336
./
../
INSTALL_RECEIPT.json
include/
lib/
/usr/local/Cellar/boost/1.52.0/./include:
./
../
boost/
@gnzlbg
gnzlbg / gist:5536032
Last active December 17, 2015 02:29
brew doctor && brew --config && brew install graphviz -v ERROR: ld: library not found for -ltclstub8.5
########################################################################################
brew doctor:
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libmacfuse_i32.2.dylib
/usr/local/lib/libmacfuse_i64.2.dylib
/usr/local/lib/libosxfuse_i32.2.dylib