Fix compile errors.

This commit is contained in:
Sönke Ludwig 2016-04-10 17:17:30 +02:00
parent ba48a6f43a
commit c3857d1bc9
2 changed files with 11 additions and 8 deletions

View file

@ -249,7 +249,7 @@ unittest {
foreach( i; 0 .. array.length )
array[i] = (start_index + i) * 0.5;
send(tid, array.move());
//send(tid, array.move()); // Isolated!T isn't recognized by std.concurrency
}
void test()
@ -270,8 +270,8 @@ unittest {
// collect results
auto resultarrays = new Isolated!(double[])[tids.length];
foreach( i, tid; tids )
resultarrays[i] = receiveOnly!(Isolated!(double[])).move();
//foreach( i, tid; tids )
// resultarrays[i] = receiveOnly!(Isolated!(double[])).move(); // Isolated!T isn't recognized by std.concurrency
// BUG: the arrays must be sorted here, but since there is no way to tell
// from where something was received, this is difficult here.
@ -1075,6 +1075,8 @@ template isCopyable(T)
value.
*/
struct Future(T) {
import vibe.internal.memory : FreeListRef;
private {
FreeListRef!(shared(T)) m_result;
Task m_task;
@ -1127,6 +1129,7 @@ Future!(ReturnType!CALLABLE) async(CALLABLE, ARGS...)(CALLABLE callable, ARGS ar
if (is(typeof(callable(args)) == ReturnType!CALLABLE))
{
import vibe.core.core;
import vibe.internal.memory : FreeListRef;
import std.functional : toDelegate;
alias RET = ReturnType!CALLABLE;

View file

@ -407,8 +407,8 @@ unittest { // run and join worker task from outside of a task
private void runWorkerTask_unsafe(CALLABLE, ARGS...)(CALLABLE callable, ref ARGS args)
{
import std.traits : ParameterTypeTuple;
import vibe.internal.meta.traits : areConvertibleTo;
import vibe.internal.meta.typetuple;
import vibe.internal.traits : areConvertibleTo;
import vibe.internal.typetuple;
alias FARGS = ParameterTypeTuple!CALLABLE;
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
@ -451,8 +451,8 @@ void runWorkerTaskDist(alias method, T, ARGS...)(shared(T) object, ARGS args)
private void runWorkerTaskDist_unsafe(CALLABLE, ARGS...)(ref CALLABLE callable, ref ARGS args)
{
import std.traits : ParameterTypeTuple;
import vibe.internal.meta.traits : areConvertibleTo;
import vibe.internal.meta.typetuple;
import vibe.internal.traits : areConvertibleTo;
import vibe.internal.typetuple;
alias FARGS = ParameterTypeTuple!CALLABLE;
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
@ -678,7 +678,7 @@ Timer setTimer(Duration timeout, void delegate() nothrow @safe callback, bool pe
///
unittest {
void printTime()
{
@safe nothrow {
import std.datetime;
logInfo("The time is: %s", Clock.currTime());
}