GitOrigin-RevId: 48135ab7ebeea8bc6b14de5734a107068cb0dc99
This commit is contained in:
Arseny Smirnov 2019-05-01 22:31:07 +02:00
parent 30e1697157
commit 83f99f6193

View File

@ -46,11 +46,11 @@ class WalkPath {
enum class Type { EnterDir, ExitDir, NotDir };
template <class F, class R = decltype(std::declval<F>()("", Type::ExitDir))>
static std::enable_if_t<std::is_same<R, Action>::value, Status> run(CSlice path, F &&func) TD_WARN_UNUSED_RESULT {
static TD_WARN_UNUSED_RESULT std::enable_if_t<std::is_same<R, Action>::value, Status> run(CSlice path, F &&func) {
return do_run(path, func);
}
template <class F, class R = decltype(std::declval<F>()("", Type::ExitDir))>
static std::enable_if_t<!std::is_same<R, Action>::value, Status> run(CSlice path, F &&func) TD_WARN_UNUSED_RESULT {
static TD_WARN_UNUSED_RESULT std::enable_if_t<!std::is_same<R, Action>::value, Status> run(CSlice path, F &&func) {
return do_run(path, [&](CSlice name, Type type) {
func(name, type);
return Action::Continue;