Skip to content

Commit

Permalink
fix and test release build
Browse files Browse the repository at this point in the history
- was complaining about `a` being used before initialized
- also failed with 2.068.1 b/c of linkage error
  • Loading branch information
MartinNowak committed Sep 11, 2015
1 parent 47ae770 commit 5bb55d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
24 changes: 8 additions & 16 deletions source/vibe/core/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -1685,28 +1685,20 @@ private string callWithMove(ARGS...)(string func, string args)

private template needsMove(T)
{
private T testCopy()()
template isCopyable(T)
{
T a = void;
T b = void;
T fun(T x) { T y = x; return y; }
b = fun(a);
return b;
enum isCopyable = __traits(compiles, (T a) { return a; });
}

private void testMove()()
template isMoveable(T)
{
T a = void;
void test(T) {}
test(a.move);
enum isMoveable = __traits(compiles, (T a) { return a.move; });
}

static if (is(typeof(testCopy!()()) == T)) enum needsMove = false;
else {
enum needsMove = true;
void test() { testMove!()(); }
static assert(is(typeof(testMove!()())), "Non-copyable type "~T.stringof~" must be movable with a .move property."~ typeof(testMove!()()));
}
enum needsMove = !isCopyable!T;

static assert(isCopyable!T || isMoveable!T,
"Non-copyable type "~T.stringof~" must be movable with a .move property.");
}

unittest {
Expand Down
1 change: 1 addition & 0 deletions travis-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -e -o pipefail

dub build -b release --compiler=$DC --config=${VIBED_DRIVER=libevent}
dub test --compiler=$DC --config=${VIBED_DRIVER=libevent}

if [ ${RUN_EXAMPLE} -eq 1 ]; then
Expand Down

0 comments on commit 5bb55d2

Please sign in to comment.