Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=ef7bf952560e983f01c6dd310c3d02f9ef3d3190
commit ef7bf952560e983f01c6dd310c3d02f9ef3d3190 Author: Michel Hermier <herm...@frugalware.org> Date: Thu Oct 2 09:49:33 2014 +0200 libpacman: Drop util/falgorithms.h. diff --git a/lib/libpacman/kernel/fsignal.h b/lib/libpacman/kernel/fsignal.h index a1ac2e9..af82569 100644 --- a/lib/libpacman/kernel/fsignal.h +++ b/lib/libpacman/kernel/fsignal.h @@ -21,7 +21,6 @@ #ifndef FSIGNAL_H #define FSIGNAL_H -#include "util/falgorithms.h" #include "util/ffunctional.h" #include <vector> // For std::vector @@ -31,6 +30,12 @@ namespace flib { +template <typename T> +T default_constructor() +{ + return T(); +} + template <typename> class FSignal; @@ -47,7 +52,7 @@ public: template <typename Accumulator = void> typename std::enable_if<!std::is_void<Accumulator>::value, Accumulator>::type operator()(Args... args) const { - Accumulator accumulator = flib::fdefault_constructor<Accumulator>(); + Accumulator accumulator = flib::default_constructor<Accumulator>(); for(const_reference connection : m_connections) { accumulator += connection(args...); diff --git a/lib/libpacman/util/falgorithms.h b/lib/libpacman/util/falgorithms.h deleted file mode 100644 index 4e28e4a..0000000 --- a/lib/libpacman/util/falgorithms.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * falgorithms.h - * - * Copyright (c) 2014 by Michel Hermier <herm...@frugalware.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - * USA. - */ -#ifndef FALGORITHMS_H -#define FALGORITHMS_H - -namespace flib -{ - -template <typename T> -T fdefault_constructor() -{ - return T(); -} - -template <typename T> -struct FAccumulator -{ - T value; - - FAccumulator() - : value(fdefault_constructor<T>()) - { } - - template <typename Any> - const T &operator += (const Any &any) - { - return value += any; - } -}; - -template <> -struct FAccumulator<void> -{ - template <typename Any> - void operator += (const Any &any) - { } -}; - -} - -#endif /* FALGORITHMS_H */ - -/* vim: set ts=2 sw=2 noet: */ _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git