From: Jay Freeman (saurik) Date: Sun, 27 Sep 2015 22:14:07 +0000 (-0700) Subject: Move Functor implementation to header for the API. X-Git-Tag: v2.1.0~87 X-Git-Url: https://git.saurik.com/ldid.git/commitdiff_plain/e6a376fc606bd28796dd1733af079d5a825c1b52?ds=inline Move Functor implementation to header for the API. --- 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);