Skip to content
Snippets Groups Projects
Commit 9d5e5d8f authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Add char type to converter.h (Now for real (untested))

parent ee148009
No related branches found
No related tags found
1 merge request!385Resolve "State key char instead of string"
Pipeline #5731 failed
......@@ -97,6 +97,8 @@ 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
if(val.length() == 1) return val.at(0);
else throw std::runtime_error("Invalid converstion to char. String too long. String provided: " + val);
throw std::runtime_error("Invalid char conversion. String provided: " + val);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment