diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-10-23 15:55:03 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-10-23 15:55:03 +0200 |
commit | 66f5c9d9b866e80d244be7fac0f613599e7bf546 (patch) | |
tree | 2b9d9d57b82a67bafd886c5156615355257538cf /src/cxpp11_common.hpp | |
parent | fda39ffd86b1bb7cfb9d62947aedc0cdbc20f8e2 (diff) |
Added a fix for compilation under Visual Studio 2013 related to the new exception classes
Diffstat (limited to 'src/cxpp11_common.hpp')
-rw-r--r-- | src/cxpp11_common.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cxpp11_common.hpp b/src/cxpp11_common.hpp index 6d967bb5..6ac008be 100644 --- a/src/cxpp11_common.hpp +++ b/src/cxpp11_common.hpp @@ -26,7 +26,11 @@ namespace clblast { template <typename Base> class Error : public Base { public: - using Base::Base; + // Perfect forwarding of the constructor since "using Base::Base" is not supported by VS 2013 + template <typename... Args> + Error(Args&&... args): + Base(std::forward<Args>(args)...) { + } }; // ================================================================================================= @@ -34,7 +38,12 @@ class Error : public Base { // Represents a generic device-specific runtime error (returned by an OpenCL or CUDA API function) class DeviceError : public Error<std::runtime_error> { public: - using Error<std::runtime_error>::Error; + // Perfect forwarding of the constructor since "using Error<std::runtime_error>::Error" is not + // supported by VS 2013 + template <typename... Args> + DeviceError(Args&&... args): + Error<std::runtime_error>(std::forward<Args>(args)...) { + } static std::string TrimCallString(const char *where) { const char *paren = strchr(where, '('); |