Fix compiler warning
This commit is contained in:
parent
d847f6469a
commit
f644b1e475
1 changed files with 3 additions and 3 deletions
|
|
@ -61,7 +61,7 @@ namespace fc {
|
||||||
class task : virtual public task_base, virtual public promise<R> {
|
class task : virtual public task_base, virtual public promise<R> {
|
||||||
public:
|
public:
|
||||||
template<typename Functor>
|
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;
|
typedef typename fc::deduce<Functor>::type FunctorType;
|
||||||
static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" );
|
static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" );
|
||||||
new ((char*)&_functor) FunctorType( fc::forward<Functor>(f) );
|
new ((char*)&_functor) FunctorType( fc::forward<Functor>(f) );
|
||||||
|
|
@ -74,11 +74,12 @@ namespace fc {
|
||||||
private:
|
private:
|
||||||
~task(){}
|
~task(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<uint64_t FunctorSize>
|
template<uint64_t FunctorSize>
|
||||||
class task<void,FunctorSize> : virtual public task_base, virtual public promise<void> {
|
class task<void,FunctorSize> : virtual public task_base, virtual public promise<void> {
|
||||||
public:
|
public:
|
||||||
template<typename Functor>
|
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;
|
typedef typename fc::deduce<Functor>::type FunctorType;
|
||||||
static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" );
|
static_assert( sizeof(f) <= sizeof(_functor), "sizeof(Functor) is larger than FunctorSize" );
|
||||||
new ((char*)&_functor) FunctorType( fc::forward<Functor>(f) );
|
new ((char*)&_functor) FunctorType( fc::forward<Functor>(f) );
|
||||||
|
|
@ -93,4 +94,3 @@ namespace fc {
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue