Skip to content

Commit

Permalink
Merge pull request vibe-d#1257 from MartinNowak/build_release
Browse files Browse the repository at this point in the history
fix and test release build
  • Loading branch information
s-ludwig committed Sep 13, 2015
2 parents 515a4e6 + 5bb55d2 commit 3a8a94d
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 [ ${BUILD_EXAMPLE=1} -eq 1 ]; then
Expand Down

0 comments on commit 3a8a94d

Please sign in to comment.