using C++17 emplace return type

This commit is contained in:
Jinhao
2018-08-27 06:51:20 +08:00
parent fe185e382b
commit 81d667dbd7
12 changed files with 78 additions and 13 deletions

View File

@@ -186,10 +186,12 @@ namespace nana
throw std::invalid_argument(excpt_what);
std::vector<std::string> rgb;
#ifdef _nana_std_has_emplace_return_type
auto const is_real = (rgb.emplace_back(i->str()).back() == '%');
#else
rgb.emplace_back(i->str());
const bool is_real = (rgb.back().back() == '%');
#endif
pat.assign(is_real ? "(\\d*\\.)?\\d+\\%" : "\\d+");
for (++i; i != end; ++i)
@@ -275,9 +277,13 @@ namespace nana
{
std::vector<std::string> rgb;
#ifdef _nana_std_has_emplace_return_type
auto const is_real = (rgb.emplace_back(std::move(str)).back() == '%');
#else
rgb.emplace_back(std::move(str));
const bool is_real = (rgb.back().back() == '%');
#endif
for (int i = 0; i < 2; ++i)
{