27template<
typename... Args>
28inline std::size_t
concat_length(
const char* cstr, Args&& ... rest);
30template<
typename StringType,
typename... Args>
31inline std::size_t
concat_length(
const StringType& str, Args&& ... rest);
33template<
typename... Args>
39template<
typename... Args>
43 return ::strlen(cstr) +
concat_length(std::forward<Args>(rest)...);
46template<
typename StringType,
typename... Args>
49 return str.size() +
concat_length(std::forward<Args>(rest)...);
52template<
typename OutStringType>
56template<
typename StringType,
typename Arg>
57using string_can_append =
decltype(std::declval<StringType&>().append(std::declval < Arg && > ()));
59template<
typename StringType,
typename Arg>
62template<
typename StringType,
typename Arg>
65template<
typename StringType,
typename Arg>
68template<
typename StringType,
typename Arg>
69using string_can_append_iter =
decltype(std::declval<StringType&>().append(std::declval<const Arg&>().begin(), std::declval<const Arg&>().end()));
71template<
typename StringType,
typename Arg>
74template<
typename StringType,
typename Arg>
75using string_can_append_data =
decltype(std::declval<StringType&>().append(std::declval<const Arg&>().
data(), std::declval<const Arg&>().size()));
77template<
typename StringType,
typename Arg>
80template <
typename OutStringType,
typename Arg,
typename... Args,
83inline void concat_into(OutStringType& out, Arg &&
arg, Args && ... rest);
85template <
typename OutStringType,
typename Arg,
typename... Args,
89inline void concat_into(OutStringType& out,
const Arg&
arg, Args && ... rest);
91template <
typename OutStringType,
typename Arg,
typename... Args,
96inline void concat_into(OutStringType& out,
const Arg&
arg, Args && ... rest);
98template<
typename OutStringType,
typename Arg,
typename... Args,
102 out.append(std::forward<Arg>(
arg));
106template <
typename OutStringType,
typename Arg,
typename... Args,
108 && detect_string_can_append_op<OutStringType, Arg>::value,
int > >
109inline void concat_into(OutStringType& out, Arg&&
arg, Args&& ... rest)
111 out += std::forward<Arg>(
arg);
115template <
typename OutStringType,
typename Arg,
typename... Args,
117 && !detect_string_can_append_op<OutStringType, Arg>::value
118 && detect_string_can_append_iter<OutStringType, Arg>::value,
int > >
121 out.append(
arg.begin(),
arg.end());
125template <
typename OutStringType,
typename Arg,
typename... Args,
127 && !detect_string_can_append_op<OutStringType, Arg>::value
128 && !detect_string_can_append_iter<OutStringType, Arg>::value
129 && detect_string_can_append_data<OutStringType, Arg>::value,
int > >
130inline void concat_into(OutStringType& out,
const Arg&
arg, Args&& ... rest)
132 out.append(
arg.data(),
arg.size());
136template<
typename OutStringType = std::string,
typename... Args>
137inline OutStringType
concat(Args && ... args)
#define WPI_JSON_NAMESPACE_END
Definition: abi_macros.h:59
#define WPI_JSON_NAMESPACE_BEGIN
Definition: abi_macros.h:53
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:256
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
\rst Returns a named argument to be used in a formatting function.
Definition: core.h:1841
detail namespace with internal helper functions
Definition: xchar.h:20
decltype(std::declval< StringType & >()+=std::declval< Arg && >()) string_can_append_op
Definition: string_concat.h:63
OutStringType concat(Args &&... args)
Definition: string_concat.h:137
is_detected< string_can_append_iter, StringType, Arg > detect_string_can_append_iter
Definition: string_concat.h:72
is_detected< string_can_append_op, StringType, Arg > detect_string_can_append_op
Definition: string_concat.h:66
is_detected< string_can_append_data, StringType, Arg > detect_string_can_append_data
Definition: string_concat.h:78
typename std::enable_if< B, T >::type enable_if_t
Definition: cpp_future.h:38
void concat_into(OutStringType &)
Definition: string_concat.h:53
decltype(std::declval< StringType & >().append(std::declval< const Arg & >().begin(), std::declval< const Arg & >().end())) string_can_append_iter
Definition: string_concat.h:69
std::size_t concat_length()
Definition: string_concat.h:22
decltype(std::declval< StringType & >().append(std::declval< Arg && >())) string_can_append
Definition: string_concat.h:57
decltype(std::declval< StringType & >().append(std::declval< const Arg & >().data(), std::declval< const Arg & >().size())) string_can_append_data
Definition: string_concat.h:75
typename detector< nonesuch, void, Op, Args... >::value_t is_detected
Definition: detected.h:48
is_detected< string_can_append, StringType, Arg > detect_string_can_append
Definition: string_concat.h:60
Definition: format.h:1762