-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathStringUtils.cpp
57 lines (48 loc) · 1.57 KB
/
StringUtils.cpp
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
47
48
49
50
51
52
53
54
55
56
57
//
// Created by Abbas Gussenov on 13.04.2023.
//
#include "StringUtils.h"
/*
template<class TOutputString, class TInputString>
TOutputString StringUtils::ToString(TInputString const&)
{
if constexpr (std::is_same_v<TOutputString, std::wstring>)
return L"std::wstring - base - cpp";
else if constexpr (std::is_same_v<TOutputString, std::string>)
return "std::string - base - cpp";
return {};
}
*/
template<>
std::wstring StringUtils::ToString<std::wstring, std::string>(std::string const& aInputString)
{
return L"std::wstring - spec - cpp";
}
/*
template
std::wstring StringUtils::ToString<std::wstring, std::string>(std::string const&);
*/
// Explicit instantiation of 'ToString<std::wstring, std::string>' that occurs after an explicit specialization has no effect
/*
template
std::wstring StringUtils::ToString(std::string const&);
*/
// Explicit instantiation of 'ToString<std::wstring, std::string>' that occurs after an explicit specialization has no effect
template<>
std::string StringUtils::ToString<std::string, std::wstring>(std::wstring const& aInputString)
{
return "std::string - spec - cpp";
}
/*
template
std::string StringUtils::ToString<std::string, std::wstring>(std::wstring const&);
*/
// Explicit instantiation of 'ToString<std::string, std::wstring>' that occurs after an explicit specialization has no effect
/*
template
std::string StringUtils::ToString(std::wstring const&);
*/
// Explicit instantiation of 'ToString<std::string, std::wstring>' that occurs after an explicit specialization has no effect
StringUtils::StringUtils()
{
}