From 87be890e07abfce431701387a81a8eb7bd94f0f7 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sun, 28 Apr 2019 15:59:09 +0900 Subject: [PATCH] feat: remove deprecated functions --- toml/get.hpp | 61 ---------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/toml/get.hpp b/toml/get.hpp index 344519f..c326846 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -558,67 +558,6 @@ T get_or(const toml::value& v, T&& opt) } } -// =========================================================================== -// get_or(table, key, fallback) -// -// DEPRECATED: use find_or instead. - -template -TOML11_MARK_AS_DEPRECATED("use toml::find_or(table, key, opt) instead.") -auto get_or(const toml::table& tab, const toml::key& ky, T&& opt) - -> decltype(get_or(std::declval(), std::forward(opt))) -{ - if(tab.count(ky) == 0) {return opt;} - return ::toml::get_or(tab.at(ky), std::forward(opt)); -} -template -TOML11_MARK_AS_DEPRECATED("use toml::find_or(table, key, opt) instead.") -auto get_or(toml::table& tab, const toml::key& ky, T&& opt) - -> decltype(get_or(std::declval(), std::forward(opt))) -{ - if(tab.count(ky) == 0) {return opt;} - return ::toml::get_or(tab[ky], std::forward(opt)); -} -template -TOML11_MARK_AS_DEPRECATED("use toml::find_or(table, key, opt) instead.") -auto get_or(toml::table&& tab, const toml::key& ky, T&& opt) - -> decltype(get_or(std::declval(), std::forward(opt))) -{ - if(tab.count(ky) == 0) {return opt;} - return ::toml::get_or(std::move(tab[ky]), std::forward(opt)); -} - -template -TOML11_MARK_AS_DEPRECATED("use toml::find_or(value, key, opt) instead.") -auto get_or(const toml::value& v, const toml::key& ky, T&& opt) - -> decltype(get_or(std::declval(), std::forward(opt))) -{ - if(!v.is_table()) {return opt;} - const auto& tab = toml::get(v); - if(tab.count(ky) == 0) {return opt;} - return ::toml::get_or(tab.at(ky), std::forward(opt)); -} -template -TOML11_MARK_AS_DEPRECATED("use toml::find_or(value, key, opt) instead.") -auto get_or(toml::value& v, const toml::key& ky, T&& opt) - -> decltype(get_or(std::declval(), std::forward(opt))) -{ - if(!v.is_table()) {return opt;} - auto& tab = toml::get(v); - if(tab.count(ky) == 0) {return opt;} - return ::toml::get_or(tab[ky], std::forward(opt)); -} -template -TOML11_MARK_AS_DEPRECATED("use toml::find_or(value, key, opt) instead.") -auto get_or(toml::value&& v, const toml::key& ky, T&& opt) - -> decltype(get_or(std::declval(), std::forward(opt))) -{ - if(!v.is_table()) {return opt;} - auto tab = toml::get(std::move(v)); - if(tab.count(ky) == 0) {return opt;} - return ::toml::get_or(std::move(tab[ky]), std::forward(opt)); -} - // =========================================================================== // find_or(value, key, fallback)