diff --git a/libs/functional/hash/examples/Jamfile.v2 b/libs/functional/hash/examples/Jamfile.v2
new file mode 100644
index 0000000..6291621
--- /dev/null
+++ b/libs/functional/hash/examples/Jamfile.v2
@@ -0,0 +1,9 @@
+
+# Copyright Daniel James 2005. Use, modification, and distribution are
+# subject to 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)
+
+run books.cpp ;
+run point.cpp ;
+run portable.cpp ;
+run template.cpp ;
diff --git a/libs/functional/hash/examples/books.cpp b/libs/functional/hash/examples/books.cpp
new file mode 100644
index 0000000..8802e0e
--- /dev/null
+++ b/libs/functional/hash/examples/books.cpp
@@ -0,0 +1,51 @@
+
+// Copyright 2005-2009 Daniel James.
+// 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)
+
+#include "./books.hpp"
+#include <boost/functional/hash.hpp>
+#include <cassert>
+
+// If std::unordered_set was available:
+//#include <unordered_set>
+
+// This example illustrates how to use ndnboost::hash with a custom hash function.
+// For full details, see the tutorial.
+
+int main()
+{
+    library::book knife(3458, "Zane Grey", "The Hash Knife Outfit");
+    library::book dandelion(1354, "Paul J. Shanley", "Hash & Dandelion Greens");
+
+    ndnboost::hash<library::book> book_hasher;
+    std::size_t knife_hash_value = book_hasher(knife);
+    (void)knife_hash_value; // suppress unused variable warning
+
+    // If std::unordered_set was available:
+    //
+    //std::unordered_set<library::book, ndnboost::hash<library::book> > books;
+    //books.insert(knife);
+    //books.insert(library::book(2443, "Lindgren, Torgny", "Hash"));
+    //books.insert(library::book(1953, "Snyder, Bernadette M.",
+    //    "Heavenly Hash: A Tasty Mix of a Mother's Meditations"));
+
+    //assert(books.find(knife) != books.end());
+    //assert(books.find(dandelion) == books.end());
+
+    return 0;
+}
+
+namespace library
+{
+    bool operator==(book const& a, book const& b)
+    {
+        return a.id == b.id;
+    }
+
+    std::size_t hash_value(book const& b)
+    {
+        ndnboost::hash<int> hasher;
+        return hasher(b.id);
+    }
+}
diff --git a/libs/functional/hash/examples/books.hpp b/libs/functional/hash/examples/books.hpp
new file mode 100644
index 0000000..195a798
--- /dev/null
+++ b/libs/functional/hash/examples/books.hpp
@@ -0,0 +1,26 @@
+
+// Copyright 2005-2009 Daniel James.
+// 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)
+
+// This example illustrates how to use ndnboost::hash with a custom hash function.
+// The implementation is contained in books.cpp
+
+#include <cstddef>
+#include <string>
+
+namespace library
+{
+    struct book
+    {
+        int id;
+        std::string author;
+        std::string title;
+
+        book(int i, std::string const& a, std::string const& t)
+            : id(i), author(a), title(t) {}
+    };
+
+    bool operator==(book const&, book const&);
+    std::size_t hash_value(book const&);
+}
diff --git a/libs/functional/hash/examples/point.cpp b/libs/functional/hash/examples/point.cpp
new file mode 100644
index 0000000..b36e3e2
--- /dev/null
+++ b/libs/functional/hash/examples/point.cpp
@@ -0,0 +1,54 @@
+
+// Copyright 2005 Daniel James.
+// 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)
+
+#include <boost/functional/hash.hpp>
+#include <cassert>
+
+// This example illustrates how to use ndnboost::hash_combine to generate a hash
+// value from the different members of a class. For full details see the hash
+// tutorial.
+
+class point
+{
+    int x;
+    int y;
+public:
+    point() : x(0), y(0) {}
+    point(int x, int y) : x(x), y(y) {}
+
+    bool operator==(point const& other) const
+    {
+        return x == other.x && y == other.y;
+    }
+
+    friend std::size_t hash_value(point const& p)
+    {
+        std::size_t seed = 0;
+        ndnboost::hash_combine(seed, p.x);
+        ndnboost::hash_combine(seed, p.y);
+
+        return seed;
+    }
+};
+
+int main()
+{
+    ndnboost::hash<point> point_hasher;
+
+    point p1(0, 0);
+    point p2(1, 2);
+    point p3(4, 1);
+    point p4 = p1;
+
+    assert(point_hasher(p1) == point_hasher(p4));
+
+    // These tests could legally fail, but if they did it'd be a pretty bad
+    // hash function.
+    assert(point_hasher(p1) != point_hasher(p2));
+    assert(point_hasher(p1) != point_hasher(p3));
+
+    return 0;
+}
+
diff --git a/libs/functional/hash/examples/portable.cpp b/libs/functional/hash/examples/portable.cpp
new file mode 100644
index 0000000..94b2e0e
--- /dev/null
+++ b/libs/functional/hash/examples/portable.cpp
@@ -0,0 +1,54 @@
+
+// Copyright 2005-2009 Daniel James.
+// 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)
+
+#include <boost/functional/hash.hpp>
+#include <cassert>
+
+// This example illustrates how to customise ndnboost::hash portably, so that
+// it'll work on both compilers that don't implement argument dependent lookup
+// and compilers that implement strict two-phase template instantiation.
+
+namespace foo
+{
+    template <class T>
+    class custom_type
+    {
+        T value;
+    public:
+        custom_type(T x) : value(x) {}
+
+        std::size_t hash() const
+        {
+            ndnboost::hash<T> hasher;
+            return hasher(value);
+        }
+    };
+}
+
+#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+namespace ndnboost
+#else
+namespace foo
+#endif
+{
+    template <class T>
+    std::size_t hash_value(foo::custom_type<T> x)
+    {
+        return x.hash();
+    }
+}
+
+int main()
+{
+    foo::custom_type<int> x(1), y(2), z(1);
+
+    ndnboost::hash<foo::custom_type<int> > hasher;
+
+    assert(hasher(x) == hasher(x));
+    assert(hasher(x) != hasher(y));
+    assert(hasher(x) == hasher(z));
+
+    return 0;
+}
diff --git a/libs/functional/hash/examples/template.cpp b/libs/functional/hash/examples/template.cpp
new file mode 100644
index 0000000..d58ef5c
--- /dev/null
+++ b/libs/functional/hash/examples/template.cpp
@@ -0,0 +1,18 @@
+
+// Copyright 2012 Daniel James.
+// 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)
+
+#include "template.hpp"
+#include <cassert>
+#include <boost/unordered_set.hpp>
+
+int main()
+{
+    typedef my_pair<int, float> pair;
+    ndnboost::unordered_set<pair> pair_set;
+    pair_set.emplace(10, 0.5f);
+
+    assert(pair_set.find(pair(10, 0.5f)) != pair_set.end());
+    assert(pair_set.find(pair(10, 0.6f)) == pair_set.end());
+}
diff --git a/libs/functional/hash/examples/template.hpp b/libs/functional/hash/examples/template.hpp
new file mode 100644
index 0000000..1817a9d
--- /dev/null
+++ b/libs/functional/hash/examples/template.hpp
@@ -0,0 +1,36 @@
+
+// Copyright 2012 Daniel James.
+// 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)
+
+// This is an example of how to write a hash function for a template
+// class.
+
+#include <boost/functional/hash_fwd.hpp>
+
+template <typename A, typename B>
+class my_pair
+{
+    A value1;
+    B value2;
+public:
+    my_pair(A const& v1, B const& v2)
+        : value1(v1), value2(v2)
+    {}
+
+    bool operator==(my_pair const& other) const
+    {
+        return value1 == other.value1 &&
+            value2 == other.value2;
+    }
+
+    friend std::size_t hash_value(my_pair const& p)
+    {
+        std::size_t seed = 0;
+        ndnboost::hash_combine(seed, p.value1);
+        ndnboost::hash_combine(seed, p.value2);
+
+        return seed;
+    }
+};
+
