mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
fix: add detail::make_error_info_rec overload
that converts basic_value to location
This commit is contained in:
@@ -41,6 +41,10 @@ struct error_info
|
|||||||
std::string suffix_; // hint or something like that
|
std::string suffix_; // hint or something like that
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// forward decl
|
||||||
|
template<typename TypeConfig>
|
||||||
|
class basic_value;
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
inline error_info make_error_info_rec(error_info e)
|
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;
|
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>
|
template<typename ... Ts>
|
||||||
error_info make_error_info_rec(error_info e,
|
error_info make_error_info_rec(error_info e,
|
||||||
source_location loc, std::string msg, Ts&& ... tail)
|
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
|
// error_info helper
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
template<typename TC, typename ... Ts>
|
template<typename TC, typename ... Ts>
|
||||||
error_info make_error_info_rec(error_info e,
|
error_info make_error_info_rec(error_info e,
|
||||||
const basic_value<TC>& v, std::string msg, Ts&& ... tail)
|
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)...);
|
return make_error_info_rec(std::move(e), v.location(), std::move(msg), std::forward<Ts>(tail)...);
|
||||||
}
|
}
|
||||||
|
} // detail
|
||||||
|
|
||||||
template<typename TC, typename ... Ts>
|
template<typename TC, typename ... Ts>
|
||||||
error_info make_error_info(
|
error_info make_error_info(
|
||||||
std::string title, const basic_value<TC>& v, std::string msg, Ts&& ... tail)
|
std::string title, const basic_value<TC>& v, std::string msg, Ts&& ... tail)
|
||||||
|
|||||||
Reference in New Issue
Block a user