22 lines
440 B
C++
22 lines
440 B
C++
#pragma once
|
|
|
|
#include <expected>
|
|
#include <system_error>
|
|
#include <type_traits>
|
|
|
|
namespace adc
|
|
{
|
|
|
|
// library-wide error type definition
|
|
|
|
typedef std::error_code adc_error_t;
|
|
|
|
template <typename VT>
|
|
using adc_result_t = std::expected<VT, adc_error_t>;
|
|
|
|
template <typename T>
|
|
concept adc_result_c = requires {
|
|
[]<typename VT>(std::type_identity<adc_result_t<VT>>) {}(std::type_identity<std::remove_cvref_t<T>>());
|
|
};
|
|
|
|
} // namespace adc
|