[core] Removed unused constructor

Not in use at the moment, was causing a compiler error on
Apple LLVM version 8.0.0 (clang-800.0.42.1).

```
src/mbgl/sprite/sprite_loader.cpp:25:11: error: call to constructor of
'Actor<mbgl::SpriteLoaderWorker>' is ambiguous
```
This commit is contained in:
Thiago Marcos P. Santos
2017-08-07 17:21:35 +03:00
parent d49c4cd61c
commit 2dd8ec8854
2 changed files with 0 additions and 39 deletions

View File

@@ -57,14 +57,6 @@ public:
object(self(), std::forward<Args>(args_)...) {
}
// Enabled for plain Objects
template <typename U = Object, class... Args,
typename std::enable_if<!std::is_constructible<U, ActorRef<Object>, Args...>::value>::type...>
Actor(Scheduler& scheduler, Args&&... args_)
: mailbox(std::make_shared<Mailbox>(scheduler)),
object(std::forward<Args>(args_)...) {
}
~Actor() {
mailbox->close();
}

View File

@@ -305,34 +305,3 @@ TEST(Actor, Ask) {
ASSERT_EQ(std::future_status::ready, status);
ASSERT_EQ(2, result.get());
}
TEST(Actor, NoSelfActorRef) {
// Not all actors need a reference to self
// Trivially constructable
struct Trivial {};
ThreadPool pool { 2 };
Actor<Trivial> trivial(pool);
// With arguments
struct WithArguments {
std::promise<void> promise;
WithArguments(std::promise<void> promise_)
: promise(std::move(promise_)) {
}
void receive() {
promise.set_value();
}
};
std::promise<void> promise;
auto future = promise.get_future();
Actor<WithArguments> withArguments(pool, std::move(promise));
withArguments.invoke(&WithArguments::receive);
future.wait();
}