diff --git a/Function.h b/Function.h index 19a5e9e..2d53582 100644 --- a/Function.h +++ b/Function.h @@ -37,12 +37,14 @@ template class Function(other)) {} + Function(Function &&other) { other.swap(*this); } template Function(F &&f) { @@ -108,7 +110,7 @@ template class Function::type; template @@ -118,10 +120,10 @@ template class Function - static void manage(void *dest, void *src, Operation op) { + static void manage(void *dest, const void *src, Operation op) { switch (op) { case Operation::Clone: - new (dest) F(*static_cast(src)); + new (dest) F(*static_cast(src)); break; case Operation::Destroy: static_cast(dest)->~F();