Skip to content

Instantly share code, notes, and snippets.

View dschwen's full-sized avatar

Daniel Schwen dschwen

View GitHub Profile
### Keybase proof
I hereby claim:
* I am dschwen on github.
* I am dschwen (https://keybase.io/dschwen) on keybase.
* I have a public key whose fingerprint is 9071 892B E0EC FB07 D778 5ACB 4D73 4E12 9611 8FE0
To claim this, I am signing this object:
#include <iostream>
// Get the hilbert index for a point along a 2D Hilbert curve.
// Daniel Schwen, 2014
//
// -------
// |01|10|
// -------
// |00|11|
// -------
@dschwen
dschwen / gist:a6bf02c1d51c0c5cac79
Created September 23, 2014 19:27
A true power operator in C++
#include <iostream>
#include <cmath>
class Exponent;
class Number {
public:
Number(double v) : value(v) {}
double getVal() const { return value; }
@dschwen
dschwen / gist:2e79eb8c2911b57de8fe
Created September 23, 2014 16:37
This compiles (double friend)
#include <iostream>
class C {
public:
class B;
class A {
public:
friend A operator+(const B & l, const B & r);
void hello() { std::cout << "hello!"; }
@dschwen
dschwen / gist:6cb72490293433e2b958
Last active August 29, 2015 14:06
Y U no compile?!!
#include <iostream>
class C {
public:
class B;
class A {
public:
friend A operator+(const B & l, const B & r);
void hello() { std::cout << "hello!"; }