From e6a376fc606bd28796dd1733af079d5a825c1b52 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 27 Sep 2015 15:14:07 -0700 Subject: [PATCH] Move Functor implementation to header for the API. --- ldid.cpp | 37 ------------------------------------- ldid.hpp | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/ldid.cpp b/ldid.cpp index 9ed5792..0cb8dd2 100644 --- a/ldid.cpp +++ b/ldid.cpp @@ -923,43 +923,6 @@ class Map { } }; -// I wish Apple cared about providing quality toolchains :/ - -template -class Functor; - -template -class Functor { - public: - virtual Type_ operator ()(Args_... args) const = 0; -}; - -template -class FunctorImpl; - -template -class FunctorImpl : - public Functor -{ - private: - const Value_ *value_; - - public: - FunctorImpl(const Value_ &value) : - value_(&value) - { - } - - virtual Type_ operator ()(Args_... args) const { - return (*value_)(args...); - } -}; - -template -FunctorImpl fun(const Function_ &value) { - return value; -} - namespace ldid { static void Allocate(void *idata, size_t isize, std::streambuf &output, const Functor &allocate, const Functor &save) { diff --git a/ldid.hpp b/ldid.hpp index ad85f03..331c4b0 100644 --- a/ldid.hpp +++ b/ldid.hpp @@ -8,6 +8,43 @@ namespace ldid { +// I wish Apple cared about providing quality toolchains :/ + +template +class Functor; + +template +class Functor { + public: + virtual Type_ operator ()(Args_... args) const = 0; +}; + +template +class FunctorImpl; + +template +class FunctorImpl : + public Functor +{ + private: + const Value_ *value_; + + public: + FunctorImpl(const Value_ &value) : + value_(&value) + { + } + + virtual Type_ operator ()(Args_... args) const { + return (*value_)(args...); + } +}; + +template +FunctorImpl fun(const Function_ &value) { + return value; +} + typedef std::map Slots; void Sign(void *idata, size_t isize, std::streambuf &output, const std::string &name, const std::string &entitlements, const std::string &key, const Slots &slots); -- 2.45.2