Fix compile errors.
This commit is contained in:
parent
ba48a6f43a
commit
c3857d1bc9
|
@ -249,7 +249,7 @@ unittest {
|
||||||
foreach( i; 0 .. array.length )
|
foreach( i; 0 .. array.length )
|
||||||
array[i] = (start_index + i) * 0.5;
|
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()
|
void test()
|
||||||
|
@ -270,8 +270,8 @@ unittest {
|
||||||
|
|
||||||
// collect results
|
// collect results
|
||||||
auto resultarrays = new Isolated!(double[])[tids.length];
|
auto resultarrays = new Isolated!(double[])[tids.length];
|
||||||
foreach( i, tid; tids )
|
//foreach( i, tid; tids )
|
||||||
resultarrays[i] = receiveOnly!(Isolated!(double[])).move();
|
// 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
|
// BUG: the arrays must be sorted here, but since there is no way to tell
|
||||||
// from where something was received, this is difficult here.
|
// from where something was received, this is difficult here.
|
||||||
|
@ -1075,6 +1075,8 @@ template isCopyable(T)
|
||||||
value.
|
value.
|
||||||
*/
|
*/
|
||||||
struct Future(T) {
|
struct Future(T) {
|
||||||
|
import vibe.internal.memory : FreeListRef;
|
||||||
|
|
||||||
private {
|
private {
|
||||||
FreeListRef!(shared(T)) m_result;
|
FreeListRef!(shared(T)) m_result;
|
||||||
Task m_task;
|
Task m_task;
|
||||||
|
@ -1127,6 +1129,7 @@ Future!(ReturnType!CALLABLE) async(CALLABLE, ARGS...)(CALLABLE callable, ARGS ar
|
||||||
if (is(typeof(callable(args)) == ReturnType!CALLABLE))
|
if (is(typeof(callable(args)) == ReturnType!CALLABLE))
|
||||||
{
|
{
|
||||||
import vibe.core.core;
|
import vibe.core.core;
|
||||||
|
import vibe.internal.memory : FreeListRef;
|
||||||
import std.functional : toDelegate;
|
import std.functional : toDelegate;
|
||||||
|
|
||||||
alias RET = ReturnType!CALLABLE;
|
alias RET = ReturnType!CALLABLE;
|
||||||
|
|
|
@ -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)
|
private void runWorkerTask_unsafe(CALLABLE, ARGS...)(CALLABLE callable, ref ARGS args)
|
||||||
{
|
{
|
||||||
import std.traits : ParameterTypeTuple;
|
import std.traits : ParameterTypeTuple;
|
||||||
import vibe.internal.meta.traits : areConvertibleTo;
|
import vibe.internal.traits : areConvertibleTo;
|
||||||
import vibe.internal.meta.typetuple;
|
import vibe.internal.typetuple;
|
||||||
|
|
||||||
alias FARGS = ParameterTypeTuple!CALLABLE;
|
alias FARGS = ParameterTypeTuple!CALLABLE;
|
||||||
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
|
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)
|
private void runWorkerTaskDist_unsafe(CALLABLE, ARGS...)(ref CALLABLE callable, ref ARGS args)
|
||||||
{
|
{
|
||||||
import std.traits : ParameterTypeTuple;
|
import std.traits : ParameterTypeTuple;
|
||||||
import vibe.internal.meta.traits : areConvertibleTo;
|
import vibe.internal.traits : areConvertibleTo;
|
||||||
import vibe.internal.meta.typetuple;
|
import vibe.internal.typetuple;
|
||||||
|
|
||||||
alias FARGS = ParameterTypeTuple!CALLABLE;
|
alias FARGS = ParameterTypeTuple!CALLABLE;
|
||||||
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
|
static assert(areConvertibleTo!(Group!ARGS, Group!FARGS),
|
||||||
|
@ -678,7 +678,7 @@ Timer setTimer(Duration timeout, void delegate() nothrow @safe callback, bool pe
|
||||||
///
|
///
|
||||||
unittest {
|
unittest {
|
||||||
void printTime()
|
void printTime()
|
||||||
{
|
@safe nothrow {
|
||||||
import std.datetime;
|
import std.datetime;
|
||||||
logInfo("The time is: %s", Clock.currTime());
|
logInfo("The time is: %s", Clock.currTime());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue