mirror of
https://github.com/matrix-construct/construct
synced 2025-03-20 16:30:23 +01:00
ircd::json: Add value constructor template to attempt cast to string_view.
This commit is contained in:
parent
d3171c9ab6
commit
fd3bb037c7
1 changed files with 6 additions and 0 deletions
|
@ -179,6 +179,12 @@ ircd::json::value::value(const std::string &str)
|
|||
:value{string_view{str}}
|
||||
{}
|
||||
|
||||
template<class T>
|
||||
ircd::json::value::value(const T &t)
|
||||
:value{static_cast<string_view>(t)}
|
||||
{
|
||||
}
|
||||
|
||||
template<size_t N>
|
||||
ircd::json::value::value(const char (&str)[N])
|
||||
:value{string_view{str}}
|
||||
|
|
Loading…
Add table
Reference in a new issue