ONE - On-device Neural Engine
Loading...
Searching...
No Matches
str.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef __PEPPER_STR_H__
18
#define __PEPPER_STR_H__
19
20
#include <ostream>
21
#include <sstream>
22
23
#include <string>
24
25
namespace
pepper
26
{
27
namespace
details
28
{
29
30
template
<
typename
... Arg>
void
str_impl
(std::ostream &os, Arg &&...args);
31
32
template
<>
inline
void
str_impl
(std::ostream &)
33
{
34
// DO NOTHING
35
return
;
36
}
37
38
template
<
typename
Arg>
inline
void
str_impl
(std::ostream &os, Arg &&arg)
39
{
40
os << std::forward<Arg>(arg);
41
}
42
43
template
<
typename
Arg,
typename
... Args>
44
inline
void
str_impl
(std::ostream &os, Arg &&arg, Args &&...args)
45
{
46
str_impl
(os, std::forward<Arg>(arg));
47
str_impl
(os, std::forward<Args>(args)...);
48
}
49
50
}
// namespace details
51
}
// namespace pepper
52
53
namespace
pepper
54
{
55
56
template
<
typename
... Args>
static
inline
std::string
str
(Args &&...args)
57
{
58
std::stringstream ss;
59
details::str_impl
(ss, std::forward<Args>(args)...);
60
return
ss.str();
61
}
62
63
}
// namespace pepper
64
65
#endif
// __PEPPER_STR_H__
infer.str
str
Definition
infer.py:18
pepper::details::str_impl
void str_impl(std::ostream &os, Arg &&...args)
pepper
Definition
csv2vec.h:24
compiler
pepper-str
include
pepper
str.h
Generated by
1.9.8