diff --git a/docs/index.rst b/docs/index.rst index a9b7ef0..011eb1c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,10 +8,6 @@ A `C++`_ package that provides utilities for error handling. API Docs -------- -.. doxygenfunction:: errors::make - -.. doxygenfunction:: errors::format - .. doxygenclass:: errors::Error :members: diff --git a/include/errors/error.hpp b/include/errors/error.hpp index 742f5f1..2b54d1c 100644 --- a/include/errors/error.hpp +++ b/include/errors/error.hpp @@ -16,9 +16,9 @@ class Error { private: const std::shared_ptr message_ptr; - public: Error(const std::shared_ptr& message_ptr); + public: /** * @brief Returns the error message. * @@ -31,6 +31,11 @@ class Error { */ std::string message() const; + friend Error make(const std::string& msg); + + template + friend Error format(fmt::format_string fmt, T&&... args); + /** * @brief Writes the string representation of an error object to the given * output stream.