microsoft/onnxruntime-extensions

Public

mirrored from https://github.com/microsoft/onnxruntime-extensionsAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2ef88b0bda3208844b2bee2ea682bc76a4085c63

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

ocos/utils.h

23lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3#pragma once
4#include <iostream>
5#include <sstream>
6
7template <typename T>
8inline void MakeStringInternal(std::ostringstream& ss, const T& t) noexcept {
9 ss << t;
10}
11
12template <typename T, typename... Args>
13void MakeStringInternal(std::ostringstream& ss, const T& t, const Args&... args) noexcept {
14 MakeStringInternal(ss, t);
15 MakeStringInternal(ss, args...);
16}
17
18template <typename... Args>
19std::string MakeString(const Args&... args) {
20 std::ostringstream ss;
21 MakeStringInternal(ss, args...);
22 return std::string(ss.str());
23}
24