MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / joinValuesToString

Function joinValuesToString

samples/common/sampleOptions.cpp:218–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216//! A helper function similar to sep.join(list) in Python.
217template <typename T>
218std::string joinValuesToString(std::vector<T> const& list, std::string const& sep)
219{
220 std::ostringstream os;
221 for (int32_t i = 0, n = list.size(); i < n; ++i)
222 {
223 os << list[i];
224 if (i != n - 1)
225 {
226 os << sep;
227 }
228 }
229 return os.str();
230}
231
232template <typename T, size_t N>
233std::string joinValuesToString(std::array<T, N> const& list, std::string const& sep)

Callers 2

sampleOptions.cppFile · 0.85
helpMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected