feat update
This commit is contained in:
parent
22f3189603
commit
40a8ffd402
@ -3,10 +3,18 @@
|
||||
|
||||
#pragma once
|
||||
#include "sled/any.h"
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
namespace sled {
|
||||
namespace failure {
|
||||
namespace {
|
||||
template<typename F, typename... Args>
|
||||
struct is_invocable : std::is_constructible<std::function<void(Args...)>,
|
||||
std::reference_wrapper<typename std::remove_reference<F>::type>> {};
|
||||
|
||||
}// namespace
|
||||
|
||||
template<typename FailureT>
|
||||
inline FailureT
|
||||
FailureFromString(std::string &&)
|
||||
@ -29,6 +37,14 @@ FailureFromString<std::string>(std::string &&str)
|
||||
return std::move(str);
|
||||
}
|
||||
|
||||
template<typename FailureT,
|
||||
typename = typename std::enable_if<std::is_constructible<FailureT, std::string>::value>::type>
|
||||
inline FailureT
|
||||
FailureFromString(std::string &&str)
|
||||
{
|
||||
return FailureT(std::move(str));
|
||||
}
|
||||
|
||||
}// namespace failure
|
||||
|
||||
namespace future_detail {
|
||||
|
Loading…
x
Reference in New Issue
Block a user