forked from eclipse-iceoryx/iceoryx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (39 loc) · 1.06 KB
/
main.cpp
File metadata and controls
48 lines (39 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <iostream>
#include <string>
using namespace std;
template<typename Source, typename Destination>
struct Into;
template<typename F, typename T>
constexpr T into(const F value) noexcept {
Into<F, T>::into(value); // just forwarding to the struct
}
template<uint64_t N>
struct Into<cxx::string<N>, std::string> {
static into(const cxx::string<N> & value) {
auto arbitraryType = value;
string newString = to_string(arbitraryType);
}
string intToStdString(int source){
string newString;
newString = to_string(source);
return newString;
}
string floatToStdString(float source){
string newString;
newString = to_string(source);
return newString;
}
string charToStdString(char source){
string newString;
newString = to_string(source);
return newString;
}
int main() {
int exampleInt = 1;
float exampleFloat = 1.0;
char exampleChar = 'a';
string newString = intToStdString(exampleInt);
string newString2 = floatToStdString(exampleFloat);
string newString3 = charToStdString(exampleChar);
return 0;
}