CaptureMoment
0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
to_string_utils.h
Go to the documentation of this file.
1
9
#pragma once
10
11
#include <string>
12
#include <concepts>
// For std::integral, std::floating_point
13
14
namespace
CaptureMoment::Core
{
15
16
namespace
utils {
17
23
template
<
typename
T>
24
concept
ToStringablePrimitive
= (std::integral<T> || std::floating_point<T>) &&
25
(!std::same_as<T, bool>);
26
37
template
<ToStringablePrimitive T>
38
[[nodiscard]] std::string
toString
(T value) {
39
return
std::to_string(value);
40
}
41
51
[[nodiscard]]
inline
std::string
toString
(
bool
value) {
52
return
value ?
"true"
:
"false"
;
53
}
54
64
[[nodiscard]]
inline
std::string
toString
(
const
std::string& value) {
65
return
value;
66
}
67
68
}
// namespace utils
69
70
}
// namespace CaptureMoment::Core
CaptureMoment::Core::utils::ToStringablePrimitive
Concept defining types that can be converted to string using std::to_string. This includes integral t...
Definition
to_string_utils.h:24
CaptureMoment::Core::utils::toString
std::string toString(T value)
Converts a primitive value (integral or floating-point) to its string representation.
Definition
to_string_utils.h:38
CaptureMoment::Core
Manages the lifecycle of a single IWorkingImage instance.
Definition
app_config.cpp:11
CaptureMoment — footer