Skip to content
Snippets Groups Projects
Commit fa200d1d authored by René Fritze's avatar René Fritze
Browse files

remove c++11 guards in source

parent c7b47dde
No related branches found
No related tags found
Loading
......@@ -67,7 +67,6 @@ std::string whitespaceify(const T& t, const char whitespace = ' ')
return ret;
} // std::string whitespaceify(const std::string s, const char whitespace = ' ')
#if HAS_LAMBDA_FUNCTIONS && HAS_STD_BEGIN_END
/** \brief convenience wrapper around boost::algorithm::split to split one string into a vector of strings
* \param msg the spring to be split
* \param seperators a list of seperaors, duh
......@@ -89,9 +88,8 @@ tokenize(const std::string& msg, const std::string& seperators,
std::begin(ret), std::end(ret), [&]() { return strings[i++].empty() ? T() : fromString<T>(strings[i - 1]); });
return ret;
}
//! if the compiler isn't recent enough we make tokenize avalilable for string only
template <>
#endif // HAS_LAMBDA_FUNCTIONS && HAS_STD_BEGIN_END
inline std::vector<std::string> tokenize(const std::string& msg, const std::string& seperators,
const boost::algorithm::token_compress_mode_type mode)
{
......
......@@ -50,13 +50,11 @@ TEST(StringTest, Tokenizer)
const vector<string> tokens_compressed = {"a", "t", "kk", "g"};
EXPECT_EQ(tokens_default, tokenize(msg, seps, boost::algorithm::token_compress_off));
EXPECT_EQ(tokens_compressed, tokenize(msg, seps, boost::algorithm::token_compress_on));
#if HAS_LAMBDA_FUNCTIONS && HAS_STD_BEGIN_END
const string num_msg("-1 2;;4");
vector<int> numbers_default = {-1, 2, 0, 4};
vector<int> numbers_compressed = {-1, 2, 4};
EXPECT_EQ(numbers_default, tokenize<int>(num_msg, seps, boost::algorithm::token_compress_off));
EXPECT_EQ(numbers_compressed, tokenize<int>(num_msg, seps, boost::algorithm::token_compress_on));
#endif
}
TEST(StringTest, TimeString)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment