mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 18:45:43 +00:00
parent
589285eb5e
commit
4a9b8b6f77
@ -24,14 +24,17 @@
|
||||
// templated. If there is any reason to create a VTKm control library,
|
||||
// this class and its subclasses should probably go there.
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
#include <vtkm/internal/ExportMacros.h> // For VTKM_OVERRIDE
|
||||
|
||||
namespace vtkm {
|
||||
namespace cont {
|
||||
|
||||
/// The superclass of all exceptions thrown by any VTKm function or method.
|
||||
///
|
||||
class Error
|
||||
class Error : public std::exception
|
||||
{
|
||||
public:
|
||||
//See note about GetMessage macro below.
|
||||
@ -47,6 +50,12 @@ public:
|
||||
const std::string &GetMessageW() const { return this->Message; }
|
||||
#endif
|
||||
|
||||
// For std::exception compatibility:
|
||||
const char* what() const VTKM_NOEXCEPT VTKM_OVERRIDE
|
||||
{
|
||||
return this->Message.c_str();
|
||||
}
|
||||
|
||||
protected:
|
||||
Error() { }
|
||||
Error(const std::string message) : Message(message) { }
|
||||
|
@ -48,8 +48,10 @@
|
||||
// sure when that we gracefully fall back to just const when using 2013
|
||||
#if defined(VTKM_MSVC) && _MSC_VER < 1900
|
||||
#define VTKM_CONSTEXPR const
|
||||
#define VTKM_NOEXCEPT
|
||||
#else
|
||||
#define VTKM_CONSTEXPR constexpr
|
||||
#define VTKM_NOEXCEPT noexcept
|
||||
#endif
|
||||
|
||||
#define VTKM_OVERRIDE override
|
||||
|
Loading…
Reference in New Issue
Block a user