Skip to content

Instantly share code, notes, and snippets.

View MrJake222's full-sized avatar

Mr. Jake MrJake222

View GitHub Profile
@beached
beached / C++ normal operators.md
Last active April 15, 2024 02:33
A list of the normal signatures of C++ operators that allow overloading

C++ Operator Signatures

This is a list of C++ operators that can be overloaded and their normal signatures(a.k.a what an int would do). The order is the preffered order to use them(The first one listed is often preffered)

Arithmetic

operator+ addition

  • free function -> T operator+( T const & lhs, T const & rhs )
  • member function -> T operator+( T const & rhs ) const

operator+ unary plus

  • member function -> T operator+( ) const
@williewillus
williewillus / primer.md
Last active April 22, 2024 15:29
1.13/1.14 update primer

This primer is licensed under CC0, do whatever you want.

BUT do note that this can be updated, so leave a link here so readers can see the updated information themselves.

1.13 and 1.14 are lumped together in this doc, you're on your own if you just want to go to 1.13 and not 1.14, for some reason.

1.15 stuff: https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e

Things in Advance

  • ResourceLocation now throw on non-snake-case names instead of silently lowercasing for you, so you probably should go and change all those string constants now. More precisely, domains must only contain alphanumeric lowercase, underscore (_), dash (-), or dot (.). Paths have the same restrictions, but can also contain forward slashes (/).
#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>