BioCMAMC-ST
results.hpp
1#ifndef __API_RESULTS_HPP__
2#define __API_RESULTS_HPP__
3
4#include <common/results.hpp>
5#include <string>
6
7struct ApiResult : Result<Success, std::string>
8{
9 explicit ApiResult(std::string_view t) noexcept
10 : Result<Success, std::string>(std::string(t))
11 {
12 }
13
14 explicit constexpr ApiResult() noexcept = default;
15 constexpr int to_c_ret_code()
16 {
17 return (valid()) ? 0 : -1;
18 }
19};
20
21#endif
ApiResult(std::string_view t) noexcept
Definition results.hpp:9
constexpr int to_c_ret_code()
Definition results.hpp:15
constexpr ApiResult() noexcept=default
constexpr bool valid() const noexcept
Definition results.hpp:27
constexpr Result() noexcept
Definition results.hpp:13