...
This commit is contained in:
22
include/adclib/adclib_common.h
Normal file
22
include/adclib/adclib_common.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user