diff --git a/test.cpp b/test.cpp index 1eb422d..aa1a484 100644 --- a/test.cpp +++ b/test.cpp @@ -135,135 +135,6 @@ namespace detail } */ -template -class MoveCaptureLamda; - -template -class MoveCaptureLamda - < - fu::identity, - fu::identity, - fu::sequence, - fu::sequence - > -{ - std::function _functional; - - std::tuple _capture; - -public: - MoveCaptureLamda(std::function&& functional, Capture&&... capture) - : _functional(std::move(functional)), _capture(std::make_tuple(std::forward(capture)...)) { } - - void operator() (Args&&... args) - { - _functional(std::move(std::get(_capture))..., std::forward(args)...); - } -}; - -template -class MoveCaptureLamda - < - fu::identity, - fu::identity, - fu::sequence, - fu::sequence - > -{ - std::function _functional; - - std::tuple _capture; - -public: - MoveCaptureLamda(std::function&& functional, Capture&&... capture) - : _functional(std::move(functional)), _capture(std::make_tuple(std::forward(capture)...)) { } - - ReturnType operator() (Args&&... args) - { - return _functional(std::move(std::get(_capture))..., std::forward(args)...); - } -}; - -/* -template -class continuable_returner -{ - _CTy returning_continuable; - -public: - continuable_returner(continuable_returner&& right) - { - returning_continuable = std::move(right.returning_continuable); - } - - continuable_returner(_CTy&& returning_continuable_) - : returning_continuable(std::move(returning_continuable_)) { } - - continuable_returner& operator= (continuable_returner&& right) - { - returning_continuable = std::move(right.returning_continuable); - return *this; - } - - continuable_returner& operator= (continuable_returner& right) - { - // returning_continuable = std::move(right.returning_continuable); - return *this; - } - - auto operator()(_ATy&&...) - -> _CTy - { - return std::move(returning_continuable); - } -}; -*/ - -/* -template -class copymove -{ - T _content; - - bool consumed; - - copymove& move(copymove& right) - { - // _content = std::move(right._content); - return *this; - } - - copymove& move(copymove&& right) - { - // _content = std::move(right._content); - return *this; - } - -public: - copymove(copymove const& right) : consumed(false) - { - // move(right._content); - } - - copymove(T& right) : consumed(false) - { - _content = std::move(right); - } - - copymove& operator= (copymove& right) - { - return move(right); - } - - T get() - { - assert(!consumed && "already consumed!"); - consumed = true; - return move(right._content); - } -}; -*/ - /* class DispatcherPool { @@ -641,41 +512,6 @@ int main(int /*argc*/, char** /*argv*/) return Log("ok, now its really finished!").then(CastSpellPromise(2)); }); - /* - continuable_returner> test26151_start(std::unique_ptr(new int(5))); - - continuable_returner> test26151_moved = std::move(test26151_start); - - std::function()> test26151_fn = std::move(test26151_moved); - */ - - // static_assert(fu::is_unwrappable::value, "not unwrappable!"); - - // std::function fntest = std::move(fn); - - MoveCaptureLamda>, fu::identity, fu::sequence_of_t<1>, fu::sequence_of_t<0>> capture( - [](std::unique_ptr capture, int arg) - { - - int i = 0; - - ++i; - - }, std::unique_ptr(new int(90))); - - capture(1); - - capture(2); - - /* - std::unique_ptr uptr(new int(90)); - copymove> mycapture(std::move(uptr)); - auto capt = [mycapture] - { - - }; - */ - // DispatcherPool countPool(1); // DispatcherPool pool;