remove some deprecated experiments

This commit is contained in:
Naios 2015-07-21 18:47:53 +02:00
parent f85b495ae2
commit e69e03926d

164
test.cpp
View File

@ -135,135 +135,6 @@ namespace detail
}
*/
template<typename Capture, typename Args, typename SeqOfCapture, typename SeqOfArgs>
class MoveCaptureLamda;
template<typename... Capture, typename... Args, std::size_t... SeqOfCapture, std::size_t... SeqOfArgs>
class MoveCaptureLamda
<
fu::identity<Capture...>,
fu::identity<void, Args...>,
fu::sequence<SeqOfCapture...>,
fu::sequence<SeqOfArgs...>
>
{
std::function<void(Capture..., Args...)> _functional;
std::tuple<Capture...> _capture;
public:
MoveCaptureLamda(std::function<void(Capture..., Args...)>&& functional, Capture&&... capture)
: _functional(std::move(functional)), _capture(std::make_tuple(std::forward<Capture>(capture)...)) { }
void operator() (Args&&... args)
{
_functional(std::move(std::get<SeqOfCapture>(_capture))..., std::forward<Args>(args)...);
}
};
template<typename... Capture, typename ReturnType, typename... Args, std::size_t... SeqOfCapture, std::size_t... SeqOfArgs>
class MoveCaptureLamda
<
fu::identity<Capture...>,
fu::identity<ReturnType, Args...>,
fu::sequence<SeqOfCapture...>,
fu::sequence<SeqOfArgs...>
>
{
std::function<ReturnType(Capture..., Args...)> _functional;
std::tuple<Capture...> _capture;
public:
MoveCaptureLamda(std::function<ReturnType(Capture..., Args...)>&& functional, Capture&&... capture)
: _functional(std::move(functional)), _capture(std::make_tuple(std::forward<Capture>(capture)...)) { }
ReturnType operator() (Args&&... args)
{
return _functional(std::move(std::get<SeqOfCapture>(_capture))..., std::forward<Args>(args)...);
}
};
/*
template<typename _CTy, typename... _ATy>
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<typename T>
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<std::unique_ptr<int>> test26151_start(std::unique_ptr<int>(new int(5)));
continuable_returner<std::unique_ptr<int>> test26151_moved = std::move(test26151_start);
std::function<std::unique_ptr<int>()> test26151_fn = std::move(test26151_moved);
*/
// static_assert(fu::is_unwrappable<TestFunctor>::value, "not unwrappable!");
// std::function<void(int)> fntest = std::move(fn);
MoveCaptureLamda<fu::identity<std::unique_ptr<int>>, fu::identity<void, int>, fu::sequence_of_t<1>, fu::sequence_of_t<0>> capture(
[](std::unique_ptr<int> capture, int arg)
{
int i = 0;
++i;
}, std::unique_ptr<int>(new int(90)));
capture(1);
capture(2);
/*
std::unique_ptr<int> uptr(new int(90));
copymove<std::unique_ptr<int>> mycapture(std::move(uptr));
auto capt = [mycapture]
{
};
*/
// DispatcherPool countPool(1);
// DispatcherPool pool;