diff options
author | tycho <work.tycho@gmail.com> | 2015-12-27 16:39:30 +0100 |
---|---|---|
committer | tycho <work.tycho@gmail.com> | 2016-01-18 17:31:46 +0100 |
commit | be1284e40a58aaeacadabfb87ccef1c4e7295cf1 (patch) | |
tree | ffafa17d4355c553e1e2e9d03d312baac0ec7276 /src/Option.h | |
parent | Fixed some type issues (diff) | |
download | cuberite-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.h | 13 |
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(); +}; |