xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.tunit
include
xtd
tunit
__tunit_join__items.hpp
Go to the documentation of this file.
1
4
#pragma once
6
#if !defined(__XTD_TUNIT_INTERNAL__)
7
#error "Do not include this file: Internal use only"
8
#endif
10
11
//#include "__default_insert_basic_ostream_operator.hpp"
12
#include <sstream>
13
#include <string>
14
16
template
<
typename
collection_t>
17
std::string __tunit_join__items(
const
collection_t& collection) {
18
std::stringstream ss;
19
ss <<
"< "
;
20
bool
first
=
true
;
21
for
(
const
auto
& item : collection) {
22
if
(!first) ss <<
", "
;
23
ss << __tunit_to_string(item);
24
first
=
false
;
25
}
26
ss <<
" >"
;
27
return
ss.str();
28
}
29
30
template
<>
31
inline
std::string __tunit_join__items<std::string>(
const
std::string& collection) {
32
std::stringstream ss;
33
ss <<
"< "
;
34
bool
first
=
true
;
35
for
(
const
char
& item : collection) {
36
if
(!first) ss <<
", "
;
37
ss <<
'\''
<< item <<
'\''
;
38
first
=
false
;
39
}
40
ss <<
" >"
;
41
return
ss.str();
42
}
xtd::first
auto first() const -> read_only_span< type_t, count >
Obtains a subspan consisting of the first count elements of the sequence.
Definition
read_only_span.hpp:249
Generated on
for xtd by
Gammasoft
. All rights reserved.