summaryrefslogtreecommitdiff
path: root/src/selectors.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-06-27 19:34:26 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-06-27 21:10:09 +0100
commitdf3bf7445dfd27389551e138333c1b42e92b30ab (patch)
treea45f531659dc443e151df53c54df6ec610e98652 /src/selectors.cc
parent7aa78d726a54fa57a8dc5ed973ab0b30eeba6bf3 (diff)
Replace boost::optional with our own implementation
Diffstat (limited to 'src/selectors.cc')
-rw-r--r--src/selectors.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/selectors.cc b/src/selectors.cc
index 838f1de1..b2b08073 100644
--- a/src/selectors.cc
+++ b/src/selectors.cc
@@ -1,11 +1,10 @@
#include "selectors.hh"
+#include "optional.hh"
#include "string.hh"
#include <algorithm>
-#include <boost/optional.hpp>
-
namespace Kakoune
{
@@ -74,9 +73,7 @@ Selection select_matching(const Buffer& buffer, const Selection& selection)
return selection;
}
-// c++14 will add std::optional, so we use boost::optional until then
-using boost::optional;
-static optional<Selection> find_surrounding(const Buffer& buffer,
+static Optional<Selection> find_surrounding(const Buffer& buffer,
ByteCoord coord,
CodepointPair matching,
ObjectFlags flags, int init_level)
@@ -103,7 +100,7 @@ static optional<Selection> find_surrounding(const Buffer& buffer,
--first;
}
if (level != 0 or *first != matching.first)
- return optional<Selection>{};
+ return Optional<Selection>{};
}
Utf8Iterator last = pos;
@@ -124,7 +121,7 @@ static optional<Selection> find_surrounding(const Buffer& buffer,
++last;
}
if (level != 0 or last == buffer.end())
- return optional<Selection>{};
+ return Optional<Selection>{};
}
if (flags & ObjectFlags::Inner)