From 034de9fadd29ba641813128d216466fcc1de8010 Mon Sep 17 00:00:00 2001 From: Philip Top Date: Thu, 24 Oct 2019 21:22:40 -0700 Subject: [PATCH] reorder the lexical_conversion definitions --- include/CLI/TypeTools.hpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/CLI/TypeTools.hpp b/include/CLI/TypeTools.hpp index bb456ca2e..29e86957c 100644 --- a/include/CLI/TypeTools.hpp +++ b/include/CLI/TypeTools.hpp @@ -749,23 +749,6 @@ bool lexical_conversion(const std::vector &strings, T &output) { return lexical_assign(strings[0], output); } -/// Lexical conversion if there is only one element but the conversion type is a vector -template ::value && !is_vector::value && is_vector::value, detail::enabler> = - detail::dummy> -bool lexical_conversion(const std::vector &strings, T &output) { - - if(strings.size() > 1 || (!strings.empty() && !(strings.front().empty()))) { - XC val; - auto retval = lexical_conversion(strings, val); - output = T{val}; - return retval; - } - output = T{}; - return true; -} - /// Lexical conversion if there is only one element but the conversion type is for two call a two element constructor template &strings, T &output) { } return (!output.empty()) && retval; } +// This one is last since it can call other lexical_conversion functions +/// Lexical conversion if there is only one element but the conversion type is a vector +template ::value && !is_vector::value && is_vector::value, detail::enabler> = + detail::dummy> +bool lexical_conversion(const std::vector &strings, T &output) { + + if(strings.size() > 1 || (!strings.empty() && !(strings.front().empty()))) { + XC val; + auto retval = lexical_conversion(strings, val); + output = T{val}; + return retval; + } + output = T{}; + return true; +} /// function template for converting tuples if the static Index is greater than the tuple size template