OSDN Git Service

YAMML::Exceptions::Exception クラスの中身を実装
authorstarg <starg@users.osdn.me>
Wed, 29 Jun 2016 14:20:30 +0000 (23:20 +0900)
committerstarg <starg@users.osdn.me>
Wed, 29 Jun 2016 14:36:30 +0000 (23:36 +0900)
include/exceptions/exception.hpp

index 36403e7..7ffbf6c 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <exception>
+#include <string>
 
 namespace YAMML
 {
@@ -12,7 +13,23 @@ namespace Exceptions
 class Exception : public std::exception
 {
 public:
-    using exception::exception;
+    Exception(const char* pMessage) : m_Message(pMessage)
+    {
+    }
+    
+    Exception(const std::string& message) : m_Message(message)
+    {
+    }
+    
+    virtual ~Exception() = default;
+    
+    virtual const char* what() const noexcept override
+    {
+        return m_Message.c_str();
+    }
+    
+private:
+    std::string m_Message;
 };
 
 } // namespace Exceptions