Added perfect forwarding of arguments

This commit is contained in:
Atlante45 2015-11-06 16:56:48 -08:00
parent d95709ee73
commit 6323728d7a
2 changed files with 10 additions and 5 deletions

View file

@ -12,7 +12,7 @@
#include "SixenseManager.h"
#ifdef HAVE_SIXENSE
#include "sixense.h"
#include <sixense.h>
#endif
#include <QCoreApplication>
@ -28,6 +28,8 @@
#include <SettingHandle.h>
#include <UserActivityLogger.h>
#include "InputPluginsLogging.h"
static const unsigned int BUTTON_0 = 1U << 0; // the skinny button between 1 and 2
static const unsigned int BUTTON_1 = 1U << 5;
static const unsigned int BUTTON_2 = 1U << 6;

View file

@ -9,11 +9,13 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
// Mock implementation of sixense.h to hide dynamic linking on OS X
#if defined(__APPLE__) && defined(HAVE_SIXENSE)
#include "sixense.h"
#include <type_traits>
#include <sixense.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QLibrary>
#include "InputPluginsLogging.h"
@ -22,8 +24,9 @@ using Library = std::unique_ptr<QLibrary>;
static Library SIXENSE;
struct Callable {
template<typename... Args> int operator() (Args... args){
return reinterpret_cast<int(*)(Args...)>(function)(args...);
template<typename... Args>
int operator() (Args&&... args){
return reinterpret_cast<int(*)(Args...)>(function)(std::forward<Args>(args)...);
}
QFunctionPointer function;
};