mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
Merge pull request #12 from ToruNiina/hotfix
enable to get toml::value as toml::value
This commit is contained in:
24
toml/get.hpp
24
toml/get.hpp
@@ -33,6 +33,30 @@ inline T&& get(value&& v)
|
||||
return std::move(v.cast<detail::toml_value_t<T>::value>());
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// T == toml::value; identity transformation.
|
||||
|
||||
template<typename T, typename std::enable_if<
|
||||
std::is_same<T, ::toml::value>::value, std::nullptr_t>::type = nullptr>
|
||||
inline T& get(value& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T, typename std::enable_if<
|
||||
std::is_same<T, ::toml::value>::value, std::nullptr_t>::type = nullptr>
|
||||
inline T const& get(const value& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T, typename std::enable_if<
|
||||
std::is_same<T, ::toml::value>::value, std::nullptr_t>::type = nullptr>
|
||||
inline T&& get(value&& v)
|
||||
{
|
||||
return std::move(v);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// integer convertible from toml::Integer
|
||||
|
||||
|
Reference in New Issue
Block a user