Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
wolf
Merge requests
!385
Resolve "State key char instead of string"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "State key char instead of string"
352-state-key-char-instead-of-string
into
devel
Overview
0
Commits
5
Pipelines
6
Changes
1
Merged
Joan Solà Ortega
requested to merge
352-state-key-char-instead-of-string
into
devel
5 years ago
Overview
0
Commits
5
Pipelines
6
Changes
1
Expand
Closes
#352 (closed)
Edited
5 years ago
by
Joan Solà Ortega
0
0
Merge request reports
Viewing commit
ee148009
Prev
Next
Show latest version
1 file
+
11
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ee148009
Add char type to converter.h
· ee148009
Joaquim Casals Buñuel
authored
5 years ago
include/core/utils/converter.h
+
11
−
0
Options
@@ -94,6 +94,14 @@ struct converter<bool>{
}
};
template
<
>
struct
converter
<
char
>
{
static
char
convert
(
std
::
string
val
){
//Here we should check that val.length() == 1 and get val[0] into a char variable
throw
std
::
runtime_error
(
"Invalid char conversion. String provided: "
+
val
);
}
};
//// TYPES ----> ToSTRING
template
<
>
struct
converter
<
std
::
string
>
{
static
std
::
string
convert
(
std
::
string
val
){
return
val
;
@@ -109,6 +117,9 @@ struct converter<std::string>{
static
std
::
string
convert
(
double
val
){
return
std
::
to_string
(
val
);
}
static
std
::
string
convert
(
char
val
){
return
std
::
to_string
(
val
);
}
template
<
typename
A
>
static
std
::
string
convert
(
utils
::
list
<
A
>
val
){
std
::
string
result
=
""
;
Loading