From 6dadff769eaa4a44af070199f19811f9ff501514 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 24 Feb 2019 21:34:27 +1100 Subject: [PATCH] posix: prefer invoke over manual calls --- posix/dir.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/posix/dir.hpp b/posix/dir.hpp index 02f05695..749fceb5 100644 --- a/posix/dir.hpp +++ b/posix/dir.hpp @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2015 Danny Robson + * Copyright 2015-2019 Danny Robson */ -#ifndef __UTIL_POSIX_DIR_HPP -#define __UTIL_POSIX_DIR_HPP +#pragma once #include "except.hpp" +#include "../debug.hpp" #include #include @@ -34,7 +34,7 @@ namespace cruft::posix { rewind (); for (dirent *cursor; errno = 0, cursor = readdir (m_handle); ) - func (cursor->d_name, args...); + std::invoke (func, args..., cursor->d_name); error::try_code (); } @@ -48,5 +48,3 @@ namespace cruft::posix { DIR *m_handle; }; } - -#endif