mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-09 22:30:07 +00:00
fix: add detail::make_error_info_rec overload
that converts basic_value to location
This commit is contained in:
parent
ccd941dc5b
commit
d4742334ce
@ -41,6 +41,10 @@ struct error_info
|
||||
std::string suffix_; // hint or something like that
|
||||
};
|
||||
|
||||
// forward decl
|
||||
template<typename TypeConfig>
|
||||
class basic_value;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
inline error_info make_error_info_rec(error_info e)
|
||||
@ -53,6 +57,10 @@ inline error_info make_error_info_rec(error_info e, std::string s)
|
||||
return e;
|
||||
}
|
||||
|
||||
template<typename TC, typename ... Ts>
|
||||
error_info make_error_info_rec(error_info e,
|
||||
const basic_value<TC>& v, std::string msg, Ts&& ... tail);
|
||||
|
||||
template<typename ... Ts>
|
||||
error_info make_error_info_rec(error_info e,
|
||||
source_location loc, std::string msg, Ts&& ... tail)
|
||||
|
@ -2026,12 +2026,16 @@ operator>=(const basic_value<TC>& lhs, const basic_value<TC>& rhs)
|
||||
}
|
||||
|
||||
// error_info helper
|
||||
namespace detail
|
||||
{
|
||||
template<typename TC, typename ... Ts>
|
||||
error_info make_error_info_rec(error_info e,
|
||||
const basic_value<TC>& v, std::string msg, Ts&& ... tail)
|
||||
{
|
||||
return make_error_info_rec(std::move(e), v.location(), std::move(msg), std::forward<Ts>(tail)...);
|
||||
}
|
||||
} // detail
|
||||
|
||||
template<typename TC, typename ... Ts>
|
||||
error_info make_error_info(
|
||||
std::string title, const basic_value<TC>& v, std::string msg, Ts&& ... tail)
|
||||
|
Loading…
Reference in New Issue
Block a user