summaryrefslogtreecommitdiffstats
path: root/src/Option.h
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-12-27 16:39:30 +0100
committertycho <work.tycho@gmail.com>2016-01-18 17:31:46 +0100
commitbe1284e40a58aaeacadabfb87ccef1c4e7295cf1 (patch)
treeffafa17d4355c553e1e2e9d03d312baac0ec7276 /src/Option.h
parentFixed some type issues (diff)
downloadcuberite-FastNBTTest.tar
cuberite-FastNBTTest.tar.gz
cuberite-FastNBTTest.tar.bz2
cuberite-FastNBTTest.tar.lz
cuberite-FastNBTTest.tar.xz
cuberite-FastNBTTest.tar.zst
cuberite-FastNBTTest.zip
Diffstat (limited to 'src/Option.h')
-rw-r--r--src/Option.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Option.h b/src/Option.h
new file mode 100644
index 000000000..f6e6e2d50
--- /dev/null
+++ b/src/Option.h
@@ -0,0 +1,13 @@
+
+
+template<class T>
+class Option
+{
+public:
+ Option(T a_value);
+ static Option<T> None();
+ template<class U, class F>
+ U To(F a_mapper, U a_default) const;
+ bool HasValue();
+ T GetValue();
+};