128 using arg_type = mpl::basic_identity_t<ArgT>;
132 constexpr bool _has_traits_type = mpl::has_traits<arg_type>(0);
133 constexpr bool _has_key_type = mpl::has_key_type<arg_type>(0);
134 constexpr bool _has_value_type = mpl::has_value_type<arg_type>(0);
135 constexpr bool _has_mapped_type = mpl::has_mapped_type<arg_type>(0);
137 if constexpr(_is_string_type)
141 return std::string{
"\""} + std::string{std::forward<ArgT>(_v)} + std::string{
"\""};
145 return std::forward<ArgT>(_v);
148 else if constexpr(_is_iterable && !_has_traits_type &&
149 (_has_value_type || (_has_key_type && _has_mapped_type)))
151 if constexpr(_has_key_type && _has_mapped_type)
153 std::stringstream _ss{};
154 _ss.setf(_cfg.
flags);
155 for(
auto&& itr : std::forward<ArgT>(_v))
159 auto _ret = _ss.str();
161 return (_ret.length() > _len) ? (std::string{_cfg.
array.
prefix} + _ret.substr(_len) +
165 else if constexpr(_has_value_type)
167 std::stringstream _ss{};
168 _ss.setf(_cfg.
flags);
169 for(
auto&& itr : std::forward<ArgT>(_v))
171 auto _ret = _ss.str();
173 return (_ret.length() > _len) ? (std::string{_cfg.
array.
prefix} + _ret.substr(_len) +
180 return std::forward<ArgT>(_v);
184 static_assert(_is_iterable,
"Type is not iterable");
185 static_assert(!_has_traits_type,
"Type has a traits type");
186 if constexpr(!_has_value_type)
188 static_assert(_has_key_type && _has_mapped_type,
189 "Type must have a key_type and mapped_type if there is no value_type");
193 static_assert(_has_value_type,
194 "Type must have a value_type if there is no key_type and mapped_type");
196 static_assert(std::is_empty<ArgT>::value,
197 "Error! argument type cannot be written to output stream");