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