changeset 637:89c1d2bd33eb

join: add missing headers
author David Demelier <markand@malikania.fr>
date Fri, 27 Apr 2018 09:04:47 +0200
parents f36b978962fb
children 25cb122ed7ef
files cpp/join/join.hpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/cpp/join/join.hpp	Mon Mar 26 13:56:05 2018 +0200
+++ b/cpp/join/join.hpp	Fri Apr 27 09:04:47 2018 +0200
@@ -21,6 +21,10 @@
  * \brief Join function
  */
 
+#include <initializer_list>
+#include <sstream>
+#include <string>
+
 /**
  * Join values by a separator and return a string.
  *
@@ -30,7 +34,7 @@
  * \return the string
  */
 template <typename InputIt, typename DelimType = char>
-std::string join(InputIt first, InputIt last, DelimType delim = ':')
+auto join(InputIt first, InputIt last, DelimType delim = ':') -> std::string
 {
     std::ostringstream oss;
 
@@ -52,7 +56,7 @@
  * \return the string
  */
 template <typename T, typename DelimType = char>
-inline std::string join(std::initializer_list<T> list, DelimType delim = ':')
+auto join(std::initializer_list<T> list, DelimType delim = ':') -> std::string
 {
     return join(list.begin(), list.end(), delim);
 }