Fix compiler warning

This commit is contained in:
Vikram Rajkumar 2014-07-27 20:46:39 -04:00
parent d847f6469a
commit f644b1e475

View file

@ -61,7 +61,7 @@ namespace fc {
class task : virtual public task_base, virtual public promise<R> {
public:
template<typename Functor>
task( Functor&& f, const char* desc ):task_base(&_functor), promise_base(desc), promise<R>(desc) {
task( Functor&& f, const char* desc ):promise_base(desc), task_base(&_functor), promise<R>(desc) {
typedef typename fc::deduce<Functor>::type FunctorType;
static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" );
new ((char*)&_functor) FunctorType( fc::forward<Functor>(f) );
@ -74,11 +74,12 @@ namespace fc {
private:
~task(){}
};
template<uint64_t FunctorSize>
class task<void,FunctorSize> : virtual public task_base, virtual public promise<void> {
public:
template<typename Functor>
task( Functor&& f, const char* desc ):task_base(&_functor), promise_base(desc), promise<void>(desc) {
task( Functor&& f, const char* desc ):promise_base(desc), task_base(&_functor), promise<void>(desc) {
typedef typename fc::deduce<Functor>::type FunctorType;
static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" );
new ((char*)&_functor) FunctorType( fc::forward<Functor>(f) );
@ -93,4 +94,3 @@ namespace fc {
};
}